Cast enum vaules to integers and cast them back where appropraite

to prevent mixed enumeration type compiler warnings
This commit is contained in:
Stan Hu
2012-07-02 14:00:45 -07:00
committed by Petteri Aimonen
parent 9b1e1b440a
commit 7c5bb6541a
2 changed files with 4 additions and 4 deletions

View File

@@ -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)