From: Caio Marcelo de Oliveira Filho Date: Wed, 2 May 2018 21:48:57 +0000 (-0700) Subject: intel/genxml: recognize 0x, 0o and 0b when setting default value X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9d1ff2261ccec49994c8162c20969b693b29639a;p=mesa.git 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 instead of Reviewed-by: Lionel Landwerlin --- diff --git a/src/intel/genxml/gen_pack_header.py b/src/intel/genxml/gen_pack_header.py index 8989f625d31..6a4c8033a70 100644 --- a/src/intel/genxml/gen_pack_header.py +++ b/src/intel/genxml/gen_pack_header.py @@ -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