[cfe-commits] r72404 - /cfe/trunk/utils/ABITest/ABITestGen.py
Eli Friedman
eli.friedman at gmail.com
Mon May 25 14:38:01 PDT 2009
Author: efriedma
Date: Mon May 25 16:38:01 2009
New Revision: 72404
URL: http://llvm.org/viewvc/llvm-project?rev=72404&view=rev
Log:
Some minor corrections: don't use offsetof on a bitfield, and cast
printf operands to long to suppress warnings.
Modified:
cfe/trunk/utils/ABITest/ABITestGen.py
Modified: cfe/trunk/utils/ABITest/ABITestGen.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/ABITest/ABITestGen.py?rev=72404&r1=72403&r2=72404&view=diff
==============================================================================
--- cfe/trunk/utils/ABITest/ABITestGen.py (original)
+++ cfe/trunk/utils/ABITest/ABITestGen.py Mon May 25 16:38:01 2009
@@ -244,16 +244,16 @@
raise NotImplementedError,'Cannot make tests values of type: "%s"'%(t,)
def printSizeOfType(self, prefix, name, t, output=None, indent=2):
- print >>output, '%*sprintf("%s: sizeof(%s) = %%ld\\n", sizeof(%s));'%(indent, '', prefix, name, name)
+ print >>output, '%*sprintf("%s: sizeof(%s) = %%ld\\n", (long)sizeof(%s));'%(indent, '', prefix, name, name)
def printAlignOfType(self, prefix, name, t, output=None, indent=2):
- print >>output, '%*sprintf("%s: __alignof__(%s) = %%ld\\n", __alignof__(%s));'%(indent, '', prefix, name, name)
+ print >>output, '%*sprintf("%s: __alignof__(%s) = %%ld\\n", (long)__alignof__(%s));'%(indent, '', prefix, name, name)
def printOffsetsOfType(self, prefix, name, t, output=None, indent=2):
if isinstance(t, RecordType):
for i,f in enumerate(t.fields):
- if f.isPaddingBitField():
+ if f.isBitField():
continue
fname = 'field%d' % i
- print >>output, '%*sprintf("%s: __builtin_offsetof(%s, %s) = %%ld\\n", __builtin_offsetof(%s, %s));'%(indent, '', prefix, name, fname, name, fname)
+ print >>output, '%*sprintf("%s: __builtin_offsetof(%s, %s) = %%ld\\n", (long)__builtin_offsetof(%s, %s));'%(indent, '', prefix, name, fname, name, fname)
def printValueOfType(self, prefix, name, t, output=None, indent=2):
if output is None:
More information about the cfe-commits
mailing list