diff options
author | Kristian H. Kristensen <[email protected]> | 2016-11-28 16:34:08 -0800 |
---|---|---|
committer | Kristian H. Kristensen <[email protected]> | 2016-11-29 22:02:49 -0800 |
commit | fc2225b1afb5c963e986ec3b94b1760355f3ec7d (patch) | |
tree | 5e648b5c65e8c97610601aef9b4062a30a0bc097 | |
parent | 8fc74b879e25627d2e1e85703cf377100da71e13 (diff) |
intel/genxml: Emit genxml enums as C enums
The previous commits got rid of any clashes between #defines and enum
values and we can now emit the genxml enums as debugger friendly C
enums.
Signed-off-by: Kristian H. Kristensen <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
-rw-r--r-- | src/intel/genxml/gen_pack_header.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/intel/genxml/gen_pack_header.py b/src/intel/genxml/gen_pack_header.py index f09667d3d8e..1024745bfb1 100644 --- a/src/intel/genxml/gen_pack_header.py +++ b/src/intel/genxml/gen_pack_header.py @@ -268,7 +268,7 @@ class Field(object): elif self.type in self.parser.structs: type = 'struct ' + self.parser.gen_prefix(safe_name(self.type)) elif self.type in self.parser.enums: - type = 'uint32_t' + type = 'enum ' + self.parser.gen_prefix(safe_name(self.type)) elif self.type == 'mbo': return else: @@ -633,14 +633,14 @@ class Parser(object): self.emit_pack_function(self.struct, self.group) def emit_enum(self): - print('/* enum %s */' % self.gen_prefix(self.enum)) + print('enum %s {' % self.gen_prefix(self.enum)) for value in self.values: if self.prefix: name = self.prefix + "_" + value.name else: name = value.name - print('#define %-36s %6d' % (name.upper(), value.value)) - print('') + print(' %-36s = %6d,' % (name.upper(), value.value)) + print('};\n') def parse(self, filename): file = open(filename, "rb") |