From 43b612a5e99ccdfb787a11b2b7c3179fc242edf3 Mon Sep 17 00:00:00 2001 From: Peter Harris Date: Wed, 12 Nov 2008 14:45:04 -0500 Subject: [PATCH] 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 --- src/c_client.py | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/c_client.py b/src/c_client.py index 99fe114..73bd064 100755 --- a/src/c_client.py +++ b/src/c_client.py @@ -17,18 +17,6 @@ _cplusplus_annoyances = {'class' : '_class', 'new' : '_new', '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 = [] _hlevel = 0 _clines = [] @@ -319,7 +307,7 @@ def _c_iterator_get_end(field, accum): return _c_iterator_get_end(field.type.last_varsized_field, accum) if field.type.is_list: # 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 + ')' else: 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. ''' - if field.field_type[0] in _cardinal_types: + if field.type.is_simple: _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('}') - if field.field_type[0] in _cardinal_types: + if field.type.member.is_simple: _hc('') _hc('') _hc('/*****************************************************************************') -- 2.34.1