diff options
author | Peter Harris <pharris@opentext.com> | 2009-02-25 18:48:50 -0500 |
---|---|---|
committer | Peter Harris <pharris@opentext.com> | 2009-02-25 19:07:23 -0500 |
commit | 9984b72888108a038d6b3f7dee374d17e26ef9e2 (patch) | |
tree | eadb4addf04800547591eaa7e8aefd223e68bf0a /src | |
parent | b08e1535cf0716fc917eaa1f5d5f6d1960bf1e3c (diff) |
Don't use enums in generated C code - use integer constants instead.
Signed-off-by: Peter Harris <pharris@opentext.com>
Diffstat (limited to 'src')
-rwxr-xr-x | src/c_client.py | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/c_client.py b/src/c_client.py index 73bd064..299ad54 100755 --- a/src/c_client.py +++ b/src/c_client.py @@ -222,17 +222,15 @@ def c_enum(self, name): ''' _h_setlevel(0) _h('') - _h('typedef enum %s {', _t(name)) - count = len(self.values) + next = -1 for (enam, eval) in self.values: - count = count - 1 - equals = ' = ' if eval != '' else '' - comma = ',' if count > 0 else '' - _h(' %s%s%s%s', _n(name + (enam,)).upper(), equals, eval, comma) - - _h('} %s;', _t(name)) + if eval == '': + next += 1 + else: + next = int(eval) + _h('static const uint32_t %s = %d;', _n(name + (enam,)).upper(), next) def _c_type_setup(self, name, postfix): ''' |