[Xcb-commit] src

Peter Harris peterh at kemper.freedesktop.org
Wed Nov 19 08:18:11 PST 2008


 src/c_client.py |   18 +++---------------
 1 file changed, 3 insertions(+), 15 deletions(-)

New commits:
commit 43b612a5e99ccdfb787a11b2b7c3179fc242edf3
Author: Peter Harris <peter.harris at hummingbird.com>
Date:   Wed Nov 12 14:45:04 2008 -0500

    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 at hummingbird.com>

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('/*****************************************************************************')


More information about the xcb-commit mailing list