[pypy-svn] r68295 - in pypy/branch/gc-compress/pypy/translator/c: . src

arigo at codespeak.net arigo at codespeak.net
Fri Oct 9 21:38:04 CEST 2009


Author: arigo
Date: Fri Oct  9 21:38:04 2009
New Revision: 68295

Modified:
   pypy/branch/gc-compress/pypy/translator/c/funcgen.py
   pypy/branch/gc-compress/pypy/translator/c/gc.py
   pypy/branch/gc-compress/pypy/translator/c/src/llgroup.h
Log:
Fix warnings.


Modified: pypy/branch/gc-compress/pypy/translator/c/funcgen.py
==============================================================================
--- pypy/branch/gc-compress/pypy/translator/c/funcgen.py	(original)
+++ pypy/branch/gc-compress/pypy/translator/c/funcgen.py	Fri Oct  9 21:38:04 2009
@@ -781,5 +781,22 @@
     def OP_PROMOTE_VIRTUALIZABLE(self, op):
         return '/* PROMOTE_VIRTUALIZABLE %s */' % op
 
+    def OP_GET_GROUP_MEMBER(self, op):
+        typename = self.db.gettype(op.result.concretetype)
+        return '%s = (%s)_OP_GET_GROUP_MEMBER(%s, %s);' % (
+            self.expr(op.result),
+            cdecl(typename, ''),
+            self.expr(op.args[0]),
+            self.expr(op.args[1]))
+
+    def OP_GET_NEXT_GROUP_MEMBER(self, op):
+        typename = self.db.gettype(op.result.concretetype)
+        return '%s = (%s)_OP_GET_NEXT_GROUP_MEMBER(%s, %s, %s);' % (
+            self.expr(op.result),
+            cdecl(typename, ''),
+            self.expr(op.args[0]),
+            self.expr(op.args[1]),
+            self.expr(op.args[2]))
+
 
 assert not USESLOTS or '__dict__' not in dir(FunctionCodeGenerator)

Modified: pypy/branch/gc-compress/pypy/translator/c/gc.py
==============================================================================
--- pypy/branch/gc-compress/pypy/translator/c/gc.py	(original)
+++ pypy/branch/gc-compress/pypy/translator/c/gc.py	Fri Oct  9 21:38:04 2009
@@ -328,14 +328,16 @@
         # expands to a number of steps, as per rpython/lltypesystem/opimpl.py,
         # all implemented by a single call to a C macro.
         [v_obj, c_grpptr, c_skipoffset, c_vtableinfo] = op.args
+        typename = funcgen.db.gettype(op.result.concretetype)
         fieldname = c_vtableinfo.value[2]
         return (
-            'OP_GET_NEXT_GROUP_MEMBER(%s, (unsigned short)%s->_%s, %s, %s);'
-            % (funcgen.expr(c_grpptr),
+        '%s = (%s)_OP_GET_NEXT_GROUP_MEMBER(%s, (unsigned short)%s->_%s, %s);'
+            % (funcgen.expr(op.result),
+               cdecl(typename, ''),
+               funcgen.expr(c_grpptr),
                funcgen.expr(v_obj),
                fieldname,
-               funcgen.expr(c_skipoffset),
-               funcgen.expr(op.result)))
+               funcgen.expr(c_skipoffset)))
 
 class AsmGcRootFrameworkGcPolicy(FrameworkGcPolicy):
     transformerclass = asmgcroot.AsmGcRootFrameworkGCTransformer

Modified: pypy/branch/gc-compress/pypy/translator/c/src/llgroup.h
==============================================================================
--- pypy/branch/gc-compress/pypy/translator/c/src/llgroup.h	(original)
+++ pypy/branch/gc-compress/pypy/translator/c/src/llgroup.h	Fri Oct  9 21:38:04 2009
@@ -5,11 +5,11 @@
 #define GROUP_MEMBER_OFFSET(group, membername)  \
   ((unsigned short)((((char*)&membername) - ((char*)&group)) / sizeof(long)))
 
-#define OP_GET_GROUP_MEMBER(groupptr, compactoffset, r)  \
-  r = ((char*)groupptr) + ((long)compactoffset)*sizeof(long)
+#define _OP_GET_GROUP_MEMBER(groupptr, compactoffset)  \
+  (((char*)groupptr) + ((long)compactoffset)*sizeof(long))
 
-#define OP_GET_NEXT_GROUP_MEMBER(groupptr, compactoffset, skipoffset, r)  \
-  r = ((char*)groupptr) + ((long)compactoffset)*sizeof(long) + skipoffset
+#define _OP_GET_NEXT_GROUP_MEMBER(groupptr, compactoffset, skipoffset)  \
+  (((char*)groupptr) + ((long)compactoffset)*sizeof(long) + skipoffset)
 
 #define OP_IS_GROUP_MEMBER_NONZERO(compactoffset, r)  \
   r = (compactoffset != 0)



More information about the Pypy-commit mailing list