[Xcb] Revised version of c_client.py

Ulrich Eckhardt doomster at knuut.de
Wed Jul 21 13:29:01 PDT 2010


I promised recently that I would be working on the looks of the generated 
sourcecode, and here are my results. I hope that the generated sources are 
equivalent to existing sources, at least libxcb builds without any errors.

Since the changes are pretty extensive, I didn't bother creating a patch. I 
can still do that, or even create a series of patches in case you want to.

Here's the list of changes made:

 * Avoid leading and double underscores in include guards.
  Macros beginning with an underscore followed by an uppercase letter
  or two consecutive underscores.
 * Clean up the mechanism to sort the output file.
  The output file contains types, functions and header/footer
  boilerplate, sort these into four arrays and use constants instead
  of magic numbers to reference them.
 * Remove various comment-placeholders.
  The output contained lots of empty "/**< */" comments, which were meant
  as placeholders for possible comments. Remove these for now, as
  the documentation doesn't exist and they thus only clutter the output.
 * Add tags for doxygen integration.
  I hope this becomes better digestible for doxygen, but I didn't actually
  test it.
 * Separate and reuse code that writes the comment header
  This allows coding the formatting in one place, instead of repeating it
  over and over again. Also, it prevents inconsistencies when manually
  coding it repeatedly.
 * Some smaller cleanups.
  Superfluous spaces, a truncated comment, formatting the boilerplate code
  consistently with the rest etc.

I'm open for any suggestions. Also, it would be nice if you just tried it to 
see if the code really is equivalent, just in case I missed some points.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: c_client.py
Type: text/x-python
Size: 35059 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/xcb/attachments/20100721/0adaef53/attachment-0001.py>

More information about the Xcb mailing list