Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
cython
Commits
0663454f
Commit
0663454f
authored
Apr 18, 2012
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix unused arguments warning for tp_new() functions without base type
parent
668a2d85
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+12
-6
No files found.
Cython/Compiler/ModuleNode.py
View file @
0663454f
...
...
@@ -991,11 +991,18 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
have_entries
,
(
py_attrs
,
py_buffers
,
memoryview_slices
)
=
\
scope
.
get_refcounted_entries
(
include_weakref
=
True
)
new_func_entry
=
scope
.
lookup_here
(
"__new__"
)
if
base_type
or
(
new_func_entry
and
new_func_entry
.
is_special
and
not
new_func_entry
.
trivial_signature
):
unused_marker
=
''
else
:
unused_marker
=
'CYTHON_UNUSED '
need_self_cast
=
type
.
vtabslot_cname
or
have_entries
code
.
putln
(
""
)
code
.
putln
(
"static PyObject *%s(PyTypeObject *t,
PyObject *a,
PyObject *k) {"
%
scope
.
mangle_internal
(
"tp_new"
))
"static PyObject *%s(PyTypeObject *t,
%sPyObject *a, %s
PyObject *k) {"
%
(
scope
.
mangle_internal
(
"tp_new"
),
unused_marker
,
unused_marker
))
if
need_self_cast
:
code
.
putln
(
"%s;"
...
...
@@ -1046,15 +1053,14 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
if
cclass_entry
.
cname
==
'__pyx_memoryviewslice'
:
code
.
putln
(
"p->from_slice.memview = NULL;"
)
entry
=
scope
.
lookup_here
(
"__new__"
)
if
entry
and
entry
.
is_special
:
if
entry
.
trivial_signature
:
if
new_func_entry
and
new_func_entry
.
is_special
:
if
new_func_entry
.
trivial_signature
:
cinit_args
=
"o, %s, NULL"
%
Naming
.
empty_tuple
else
:
cinit_args
=
"o, a, k"
code
.
putln
(
"if (%s(%s) < 0) {"
%
(
entry
.
func_cname
,
cinit_args
))
(
new_func_
entry
.
func_cname
,
cinit_args
))
code
.
put_decref_clear
(
"o"
,
py_object_type
,
nanny
=
False
);
code
.
putln
(
"}"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment