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
Gwenaël Samain
cython
Commits
a084a7b0
Commit
a084a7b0
authored
Aug 03, 2011
by
Vitja Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Only mark skip_dispatch arg as unused if function has OverrideCheckNode
parent
8a3aa54b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+9
-3
No files found.
Cython/Compiler/Nodes.py
View file @
a084a7b0
...
@@ -1670,6 +1670,7 @@ class CFuncDefNode(FuncDefNode):
...
@@ -1670,6 +1670,7 @@ class CFuncDefNode(FuncDefNode):
inline_in_pxd
=
False
inline_in_pxd
=
False
decorators
=
None
decorators
=
None
directive_locals
=
None
directive_locals
=
None
override
=
None
def
unqualified_name
(
self
):
def
unqualified_name
(
self
):
return
self
.
entry
.
name
return
self
.
entry
.
name
...
@@ -1802,7 +1803,12 @@ class CFuncDefNode(FuncDefNode):
...
@@ -1802,7 +1803,12 @@ class CFuncDefNode(FuncDefNode):
arg_decl
=
'CYTHON_UNUSED %s'
%
arg_decl
arg_decl
=
'CYTHON_UNUSED %s'
%
arg_decl
arg_decls
.
append
(
arg_decl
)
arg_decls
.
append
(
arg_decl
)
if
with_dispatch
and
self
.
overridable
:
if
with_dispatch
and
self
.
overridable
:
arg_decls
.
append
(
PyrexTypes
.
c_int_type
.
declaration_code
(
Naming
.
skip_dispatch_cname
))
dispatch_arg
=
PyrexTypes
.
c_int_type
.
declaration_code
(
Naming
.
skip_dispatch_cname
)
if
self
.
override
:
arg_decls
.
append
(
dispatch_arg
)
else
:
arg_decls
.
append
(
'CYTHON_UNUSED %s'
%
dispatch_arg
)
if
type
.
optional_arg_count
and
with_opt_args
:
if
type
.
optional_arg_count
and
with_opt_args
:
arg_decls
.
append
(
type
.
op_arg_struct
.
declaration_code
(
Naming
.
optional_args_cname
))
arg_decls
.
append
(
type
.
op_arg_struct
.
declaration_code
(
Naming
.
optional_args_cname
))
if
type
.
has_varargs
:
if
type
.
has_varargs
:
...
@@ -1832,7 +1838,7 @@ class CFuncDefNode(FuncDefNode):
...
@@ -1832,7 +1838,7 @@ class CFuncDefNode(FuncDefNode):
for
arg
in
self
.
args
:
for
arg
in
self
.
args
:
if
arg
.
default
:
if
arg
.
default
:
entry
=
scope
.
lookup
(
arg
.
name
)
entry
=
scope
.
lookup
(
arg
.
name
)
if
self
.
overrid
abl
e
or
entry
.
cf_used
:
if
self
.
override
or
entry
.
cf_used
:
result
=
arg
.
calculate_default_value_code
(
code
)
result
=
arg
.
calculate_default_value_code
(
code
)
code
.
putln
(
'%s = %s;'
%
(
code
.
putln
(
'%s = %s;'
%
(
arg
.
type
.
declaration_code
(
arg
.
cname
),
result
))
arg
.
type
.
declaration_code
(
arg
.
cname
),
result
))
...
@@ -1849,7 +1855,7 @@ class CFuncDefNode(FuncDefNode):
...
@@ -1849,7 +1855,7 @@ class CFuncDefNode(FuncDefNode):
for
arg
in
self
.
args
:
for
arg
in
self
.
args
:
if
arg
.
default
:
if
arg
.
default
:
entry
=
scope
.
lookup
(
arg
.
name
)
entry
=
scope
.
lookup
(
arg
.
name
)
if
self
.
overrid
abl
e
or
entry
.
cf_used
:
if
self
.
override
or
entry
.
cf_used
:
code
.
putln
(
'if (%s->%sn > %s) {'
%
code
.
putln
(
'if (%s->%sn > %s) {'
%
(
Naming
.
optional_args_cname
,
(
Naming
.
optional_args_cname
,
Naming
.
pyrex_prefix
,
i
))
Naming
.
pyrex_prefix
,
i
))
...
...
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