fix vtable slot filling to silent strict aliasing warnings in Py2
authorLisandro Dalcin <dalcinl@gmail.com>
Mon, 13 Sep 2010 19:03:00 +0000 (16:03 -0300)
committerLisandro Dalcin <dalcinl@gmail.com>
Mon, 13 Sep 2010 19:03:00 +0000 (16:03 -0300)
Cython/Compiler/ModuleNode.py

index 9eb18e77ade5960b088b103c5572bc7f167e2532..27188d3d4b443e448d584be8dc4b9c29702eb0f4 100644 (file)
@@ -2117,7 +2117,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
                 entry for entry in type.scope.cfunc_entries
                 if entry.func_cname ]
             if c_method_entries:
-                code.putln('#if PY_MAJOR_VERSION >= 3')
                 for meth_entry in c_method_entries:
                     cast = meth_entry.type.signature_cast_string()
                     code.putln(
@@ -2126,14 +2125,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
                             meth_entry.cname,
                             cast,
                             meth_entry.func_cname))
-                code.putln('#else')
-                for meth_entry in c_method_entries:
-                    code.putln(
-                        "*(void(**)(void))&%s.%s = (void(*)(void))%s;" % (
-                            type.vtable_cname,
-                            meth_entry.cname,
-                            meth_entry.func_cname))
-                code.putln('#endif')
     
     def generate_typeptr_assignment_code(self, entry, code):
         # Generate code to initialise the typeptr of an extension