mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-05 16:09:07 -04:00
decompiler: GUInt properties for gunichar needs conversion
Fix #148 Signed-off-by: Hubert Figuière <hub@figuiere.net>
This commit is contained in:
parent
d47955c5a2
commit
7823b5b2a8
4 changed files with 27 additions and 0 deletions
|
@ -118,6 +118,15 @@ class DecompileCtx:
|
|||
|
||||
if type is None:
|
||||
self.print(f"{name}: {escape_quote(value)};")
|
||||
elif type.assignable_to(UIntType()):
|
||||
try:
|
||||
val = int(value)
|
||||
self.print(f"{name}: {value};")
|
||||
except:
|
||||
# Properties like 'invisible-char' are a unicode char
|
||||
# in a guint, so we convert manually. Unlike in format.
|
||||
val = ord(value)
|
||||
self.print(f"{name}: {val};")
|
||||
elif type.assignable_to(FloatType()):
|
||||
self.print(f"{name}: {value};")
|
||||
elif type.assignable_to(BoolType()):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue