Treat XIDs the same as other cardinal values.

This fixes a bug where c_client.py wasn't generating *_end functions,
but expected them to exist in order to find the subsequent list's start.

Signed-off-by: Peter Harris <peter.harris@hummingbird.com>
This commit is contained in:
Peter Harris 2008-11-12 14:45:04 -05:00
parent 902cade8ec
commit 43b612a5e9

View File

@ -17,18 +17,6 @@ _cplusplus_annoyances = {'class' : '_class',
'new' : '_new', 'new' : '_new',
'delete': '_delete'} 'delete': '_delete'}
_cardinal_types = ['CARD8', 'uint8_t',
'CARD16','uint16_t',
'CARD32','uint32_t',
'INT8', 'int8_t',
'INT16', 'int16_t',
'INT32', 'int32_t',
'BYTE',
'BOOL',
'char',
'void',
'float',
'double']
_hlines = [] _hlines = []
_hlevel = 0 _hlevel = 0
_clines = [] _clines = []
@ -319,7 +307,7 @@ def _c_iterator_get_end(field, accum):
return _c_iterator_get_end(field.type.last_varsized_field, accum) return _c_iterator_get_end(field.type.last_varsized_field, accum)
if field.type.is_list: if field.type.is_list:
# XXX we can always use the first way # XXX we can always use the first way
if field.type.c_type in _cardinal_types: if field.type.member.is_simple:
return field.c_end_name + '(' + accum + ')' return field.c_end_name + '(' + accum + ')'
else: else:
return field.type.member.c_end_name + '(' + field.c_iterator_name + '(' + accum + '))' return field.type.member.c_end_name + '(' + field.c_iterator_name + '(' + accum + '))'
@ -455,7 +443,7 @@ def _c_accessors_field(self, field):
''' '''
Declares the accessor functions for a non-list field that follows a variable-length field. Declares the accessor functions for a non-list field that follows a variable-length field.
''' '''
if field.field_type[0] in _cardinal_types: if field.type.is_simple:
_hc('') _hc('')
_hc('') _hc('')
_hc('/*****************************************************************************') _hc('/*****************************************************************************')
@ -547,7 +535,7 @@ def _c_accessors_list(self, field):
_c(' return %s;', _c_accessor_get_expr(field.type.expr, 'R')) _c(' return %s;', _c_accessor_get_expr(field.type.expr, 'R'))
_c('}') _c('}')
if field.field_type[0] in _cardinal_types: if field.type.member.is_simple:
_hc('') _hc('')
_hc('') _hc('')
_hc('/*****************************************************************************') _hc('/*****************************************************************************')