diff options
author | Peter Harris <peter.harris@hummingbird.com> | 2008-11-12 14:45:04 -0500 |
---|---|---|
committer | Peter Harris <peter.harris@hummingbird.com> | 2008-11-19 11:06:01 -0500 |
commit | 43b612a5e99ccdfb787a11b2b7c3179fc242edf3 (patch) | |
tree | 506eb9adcf459f912492efa1144d1ed302f7e1f2 /src | |
parent | 902cade8ec9e7eb5d29f6f6d61cac0470c300aec (diff) |
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>
Diffstat (limited to 'src')
-rwxr-xr-x | src/c_client.py | 18 |
1 files 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('/*****************************************************************************') |