Commit 345db432 authored by Lisandro Dalcin's avatar Lisandro Dalcin

fix vtable slot filling to silent strict aliasing warnings in Py2

parent 901903e8
...@@ -2117,7 +2117,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -2117,7 +2117,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
entry for entry in type.scope.cfunc_entries entry for entry in type.scope.cfunc_entries
if entry.func_cname ] if entry.func_cname ]
if c_method_entries: if c_method_entries:
code.putln('#if PY_MAJOR_VERSION >= 3')
for meth_entry in c_method_entries: for meth_entry in c_method_entries:
cast = meth_entry.type.signature_cast_string() cast = meth_entry.type.signature_cast_string()
code.putln( code.putln(
...@@ -2126,14 +2125,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -2126,14 +2125,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
meth_entry.cname, meth_entry.cname,
cast, cast,
meth_entry.func_cname)) 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): def generate_typeptr_assignment_code(self, entry, code):
# Generate code to initialise the typeptr of an extension # Generate code to initialise the typeptr of an extension
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment