[PATCH] Add ~ operator support in code generator

Marcin Kościelnicki koriakin at 0x04.net
Thu May 13 14:05:57 PDT 2010


---
 src/c_client.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/c_client.py b/src/c_client.py
index d86d05e..4f3b089 100755
--- a/src/c_client.py
+++ b/src/c_client.py
@@ -448,7 +448,9 @@ def _c_accessor_get_expr(expr, prefix=''):
     '''
     lenexp = _c_accessor_get_length(expr, prefix)
 
-    if expr.op != None:
+    if expr.op == '~':
+        return '(' + '~' + _c_accessor_get_expr(expr.rhs, prefix) + ')'
+    elif expr.op != None:
         return '(' + _c_accessor_get_expr(expr.lhs, prefix) + ' ' + expr.op + ' ' + _c_accessor_get_expr(expr.rhs, prefix) + ')'
     elif expr.bitfield:
         return 'xcb_popcount(' + lenexp + ')'
-- 
1.7.0.2



More information about the xorg-devel mailing list