mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
typelib: Fix byte order issue
This commit is contained in:
parent
0c02195510
commit
057c767fbb
1 changed files with 3 additions and 3 deletions
|
@ -64,11 +64,11 @@ class Field:
|
|||
if not mask or sys.byteorder == "little":
|
||||
self._shift = shift
|
||||
elif self._type == "u8" or self._type == "i8":
|
||||
self._shift = 7 - shift
|
||||
self._shift = 8 - (shift + mask)
|
||||
elif self._type == "u16" or self._type == "i16":
|
||||
self._shift = 15 - shift
|
||||
self._shift = 16 - (shift + mask)
|
||||
else:
|
||||
self._shift = 31 - shift
|
||||
self._shift = 32 - (shift + mask)
|
||||
self._mask = (1 << mask) - 1 if mask else None
|
||||
self._name = f"{offset}__{type}__{shift}__{mask}"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue