Commit a31a76c4 authored by Stefan Behnel's avatar Stefan Behnel

fix C compiler warning about unused function parameter in tp_clear()

parent 12bed2b0
......@@ -1256,8 +1256,6 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
base_type = scope.parent_type.base_type
if tp_slot.slot_code(scope) != slot_func:
return # never used
code.putln("")
code.putln("static int %s(PyObject *o) {" % slot_func)
py_attrs = []
py_buffers = []
......@@ -1267,6 +1265,14 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
if entry.type == PyrexTypes.c_py_buffer_type:
py_buffers.append(entry)
if py_attrs or py_buffers or base_type:
unused = ''
else:
unused = 'CYTHON_UNUSED '
code.putln("")
code.putln("static int %s(%sPyObject *o) {" % (slot_func, unused))
if py_attrs or py_buffers:
self.generate_self_cast(scope, code)
code.putln("PyObject* tmp;")
......
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