diff options
author | José Fonseca <jfonseca@vmware.com> | 2009-05-04 11:05:11 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2009-05-04 11:05:11 +0100 |
commit | 47e85e1627ee44eef1991dff3e32a825d76aec34 (patch) | |
tree | 582968b43c7d8639ddac726c839c8d6c2bd64528 | |
parent | ed9c01691f79722a1163059a9e381dba0720cfc8 (diff) |
Strip trailing zeros from bitmasks.
-rw-r--r-- | base.py | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -203,13 +203,21 @@ class Flags(Concrete): return str(self.type) def _dump(self, instance): + print ' bool l_First = TRUE;' print ' %s l_Value = %s;' % (self.type, instance) for value in self.values: print ' if((l_Value & %s) == %s) {' % (value, value) - print ' Log::Text("%s | ");' % value + print ' if(!l_First)' + print ' Log::Text(" | ");' + print ' Log::Text("%s");' % value print ' l_Value &= ~%s;' % value + print ' l_First = FALSE;' print ' }' + print ' if(l_Value || l_First) {' + print ' if(!l_First)' + print ' Log::Text(" | ");' self.type.dump("l_Value"); + print ' }' class Struct(Concrete): |