Remove the need of converting values that are documented in
hexadecimal. This patch would allow writing
<field name="3D Command Sub Opcode" ... default="0x1B"/>
instead of
<field name="3D Command Sub Opcode" ... default="27"/>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
self.prefix = None
if "default" in attrs:
- self.default = int(attrs["default"])
+ # Base 0 recognizes 0x, 0o, 0b prefixes in addition to decimal ints.
+ self.default = int(attrs["default"], base=0)
else:
self.default = None