mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
intel/genxml: recognize 0x, 0o and 0b when setting default value
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>
This commit is contained in:
parent
9a10a2fd5f
commit
9d1ff2261c
1 changed files with 2 additions and 1 deletions
|
|
@ -241,7 +241,8 @@ class Field(object):
|
|||
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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue