mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
Handle big endian bitfields correctly
This commit is contained in:
parent
3cd5daf025
commit
0c02195510
2 changed files with 15 additions and 5 deletions
|
@ -18,6 +18,7 @@
|
|||
# SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
|
||||
import os
|
||||
import sys
|
||||
import typing as T
|
||||
from functools import cached_property
|
||||
|
||||
|
@ -948,8 +949,8 @@ class Repository(GirNode):
|
|||
return self.lookup_namespace(ns).get_type(dir_entry.DIR_ENTRY_NAME)
|
||||
|
||||
def _resolve_type_id(self, type_id: int) -> GirType:
|
||||
if type_id & 0xFFFFFF == 0:
|
||||
type_id = (type_id >> 27) & 0x1F
|
||||
if type_id & (0xFFFFFF if sys.byteorder == "little" else 0xFFFFFF00) == 0:
|
||||
type_id = ((type_id >> 27) if sys.byteorder == "little" else type_id) & 0x1F
|
||||
# simple type
|
||||
if type_id == typelib.TYPE_BOOLEAN:
|
||||
return BoolType()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue