[Xcb] [lib 5/5] c_client.py: No sizeofs for Events, Replies, Requests

Daniel Martin consume.noise at gmail.com
Fri Nov 22 14:27:32 PST 2013

Don't generate _sizeof() functions for Events, Replies and Requests.
Those sizeof functions are used to iterate over lists with variadic
sized elements. But, there're no lists of Events, Replies or Requests
that would require such a helper function for the iterator.

Signed-off-by: Daniel Martin <consume.noise at gmail.com>
 src/c_client.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/c_client.py b/src/c_client.py
index 59cc19a..362a3a1 100644
--- a/src/c_client.py
+++ b/src/c_client.py
@@ -428,8 +428,8 @@ def _c_type_setup(self, name, postfix):
                 #   special cases -> unserialize
                 if self.is_switch or self.var_followed_by_fixed_fields:
                     _c_serialize('unserialize', self)
-        if self.need_sizeof:
+        if self.need_sizeof and not isinstance(self, (Event, Reply, Request)):
             if self.c_sizeof_name not in finished_sizeof:
                 if not module.namespace.is_ext or self.name[:2] == module.namespace.prefix:

More information about the Xcb mailing list