diff options
author | marha <marha@users.sourceforge.net> | 2010-05-18 13:54:22 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-05-18 13:54:22 +0000 |
commit | 96bd0f520fd4a3a8c54e76638985389f60d936e0 (patch) | |
tree | 32643acb5ff4fc3b8a35c7842f94dea7d69c2c73 /libxcb/src/c_client.py | |
parent | 4787c5a8db870b0cff2326bd750c4d96c7d84e51 (diff) | |
parent | a457b80612b4f37be47099e9a0f38c4fc2a42252 (diff) | |
download | vcxsrv-96bd0f520fd4a3a8c54e76638985389f60d936e0.tar.gz vcxsrv-96bd0f520fd4a3a8c54e76638985389f60d936e0.tar.bz2 vcxsrv-96bd0f520fd4a3a8c54e76638985389f60d936e0.zip |
svn merge "^/branches/released" .
Diffstat (limited to 'libxcb/src/c_client.py')
-rw-r--r-- | libxcb/src/c_client.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libxcb/src/c_client.py b/libxcb/src/c_client.py index ad7a6ccd2..6241239e6 100644 --- a/libxcb/src/c_client.py +++ b/libxcb/src/c_client.py @@ -479,7 +479,8 @@ def _c_accessors_field(self, field): _c('%s (const %s *R /**< */)', field.c_accessor_name, self.c_type)
_c('{')
_c(' xcb_generic_iterator_t prev = %s;', _c_iterator_get_end(field.prev_varsized_field, 'R'))
- _c(' return * (%s *) ((char *) prev.data + XCB_TYPE_PAD(%s, prev.index) + %d);', field.c_field_type, field.first_field_after_varsized.type.c_type, field.prev_varsized_offset)
+ sizeoftype='char' if field.first_field_after_varsized.type.c_type == 'void' else field.first_field_after_varsized.type.c_type
+ _c(' return * (%s *) ((char *) prev.data + XCB_TYPE_PAD(%s, prev.index) + %d);', field.c_field_type, sizeoftype, field.prev_varsized_offset)
_c('}')
else:
_hc('')
@@ -498,7 +499,8 @@ def _c_accessors_field(self, field): _c('%s (const %s *R /**< */)', field.c_accessor_name, self.c_type)
_c('{')
_c(' xcb_generic_iterator_t prev = %s;', _c_iterator_get_end(field.prev_varsized_field, 'R'))
- _c(' return (%s *) ((char *) prev.data + XCB_TYPE_PAD(%s, prev.index) + %d);', field.c_field_type, field.first_field_after_varsized.type.c_type, field.prev_varsized_offset)
+ sizeoftype='char' if field.first_field_after_varsized.type.c_type == 'void' else field.first_field_after_varsized.type.c_type
+ _c(' return (%s *) ((char *) prev.data + XCB_TYPE_PAD(%s, prev.index) + %d);', field.c_field_type, sizeoftype, field.prev_varsized_offset)
_c('}')
def _c_accessors_list(self, field):
@@ -532,7 +534,8 @@ def _c_accessors_list(self, field): _c(' return (%s *) (R + 1);', field.c_field_type)
else:
_c(' xcb_generic_iterator_t prev = %s;', _c_iterator_get_end(field.prev_varsized_field, 'R'))
- _c(' return (%s *) ((char *) prev.data + XCB_TYPE_PAD(%s, prev.index) + %d);', field.c_field_type, field.first_field_after_varsized.type.c_type, field.prev_varsized_offset)
+ sizeoftype='char' if field.first_field_after_varsized.type.c_type == 'void' else field.first_field_after_varsized.type.c_type
+ _c(' return (%s *) ((char *) prev.data + XCB_TYPE_PAD(%s, prev.index) + %d);', field.c_field_type, sizeoftype, field.prev_varsized_offset)
_c('}')
@@ -605,7 +608,8 @@ def _c_accessors_list(self, field): _c(' i.data = (%s *) (R + 1);', field.c_field_type)
else:
_c(' xcb_generic_iterator_t prev = %s;', _c_iterator_get_end(field.prev_varsized_field, 'R'))
- _c(' i.data = (%s *) ((char *) prev.data + XCB_TYPE_PAD(%s, prev.index));', field.c_field_type, field.c_field_type)
+ sizeoftype='char' if field.c_field_type == 'void' else field.c_field_type
+ _c(' i.data = (%s *) ((char *) prev.data + XCB_TYPE_PAD(%s, prev.index));', field.c_field_type, sizeoftype)
_c(' i.rem = %s;', _c_accessor_get_expr(field.type.expr, 'R'))
_c(' i.index = (char *) i.data - (char *) R;')
|