diff options
author | Stan Hu <stanhu@aclimalabs.com> | 2012-07-02 14:00:45 -0700 |
---|---|---|
committer | Petteri Aimonen <jpa@git.mail.kapsi.fi> | 2012-07-05 18:13:50 +0300 |
commit | 7c5bb6541a820dd4721358226ca3815d94736863 (patch) | |
tree | 45c0fa319336df5f4635399ce46894b84ba550e4 /generator/nanopb_generator.py | |
parent | 9b1e1b440ab6a21bacab939b9c7bef0fa4ca5c90 (diff) |
Cast enum vaules to integers and cast them back where appropraite
to prevent mixed enumeration type compiler warnings
Diffstat (limited to 'generator/nanopb_generator.py')
-rw-r--r-- | generator/nanopb_generator.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/generator/nanopb_generator.py b/generator/nanopb_generator.py index 9e2a30ed..1925167f 100644 --- a/generator/nanopb_generator.py +++ b/generator/nanopb_generator.py @@ -217,10 +217,10 @@ class Field: prev_field_name is the name of the previous field or None. ''' result = ' {%d, ' % self.tag - result += self.htype + result += '(pb_type_t) ((int) ' + self.htype if self.ltype is not None: - result += ' | ' + self.ltype - result += ',\n' + result += ' | (int) ' + self.ltype + result += '),\n' if prev_field_name is None: result += ' offsetof(%s, %s),' % (self.struct_name, self.name) |