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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
fe2191ac
Commit
fe2191ac
authored
May 01, 2011
by
Mark Florisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a little bug
parent
8ff5f8b8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
19 deletions
+26
-19
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+2
-1
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+10
-6
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+14
-12
No files found.
Cython/Compiler/ExprNodes.py
View file @
fe2191ac
...
...
@@ -3008,7 +3008,8 @@ class SimpleCallNode(CallNode):
if
overloaded_entry
:
if
self
.
function
.
type
.
is_fused
:
alternatives
=
[]
self
.
function
.
type
.
map_with_specific_entries
(
alternatives
.
append
)
PyrexTypes
.
map_with_specific_entries
(
self
.
function
.
entry
,
alternatives
.
append
)
else
:
alternatives
=
overloaded_entry
.
all_alternatives
()
...
...
Cython/Compiler/ModuleNode.py
View file @
fe2191ac
...
...
@@ -156,8 +156,10 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
f
.
close
()
def
generate_public_declaration
(
self
,
entry
,
h_code
,
i_code
):
entry
.
type
.
map_with_specific_entries
(
self
.
_generate_public_declaration
,
h_code
,
i_code
)
PyrexTypes
.
map_with_specific_entries
(
entry
,
self
.
_generate_public_declaration
,
h_code
,
i_code
)
def
_generate_public_declaration
(
self
,
entry
,
h_code
,
i_code
):
h_code
.
putln
(
"%s %s;"
%
(
...
...
@@ -990,9 +992,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
dll_linkage
=
"DL_EXPORT"
,
definition
=
definition
)
def
generate_cfunction_predeclarations
(
self
,
env
,
code
,
definition
):
func
=
self
.
_generate_cfunction_predeclaration
for
entry
in
env
.
cfunc_entries
:
entry
.
type
.
map_with_specific_entries
(
self
.
_generate_cfunction_predeclaration
,
code
,
definition
)
PyrexTypes
.
map_with_specific_entries
(
entry
,
func
,
code
,
definition
)
def
_generate_cfunction_predeclaration
(
self
,
entry
,
code
,
definition
):
if
entry
.
inline_func_in_pxd
or
(
not
entry
.
in_cinclude
and
(
definition
...
...
@@ -2050,7 +2052,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
for
entry
in
env
.
cfunc_entries
:
from_fused
=
entry
.
type
.
is_fused
if
entry
.
api
or
entry
.
defined_in_pxd
:
entry
.
type
.
map_with_specific_entries
(
func
,
env
,
code
,
from_fused
)
PyrexTypes
.
map_with_specific_entries
(
entry
,
func
,
env
,
code
,
from_fused
)
def
_generate_c_function_export_code
(
self
,
entry
,
env
,
code
,
from_fused
):
env
.
use_utility_code
(
function_export_utility_code
)
...
...
@@ -2094,7 +2097,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code
.
error_goto
(
self
.
pos
)))
for
entry
in
entries
:
entry
.
type
.
map_with_specific_entries
(
self
.
_import_cdef_func
,
PyrexTypes
.
map_with_specific_entries
(
entry
,
self
.
_import_cdef_func
,
code
,
temp
,
entry
.
type
.
is_fused
)
...
...
Cython/Compiler/PyrexTypes.py
View file @
fe2191ac
...
...
@@ -2056,26 +2056,28 @@ class CFuncType(CType):
fused_cname
,
self
.
entry
.
func_cname
)
def
map_with_specific_entries
(
self
,
func
,
*
args
,
**
kwargs
):
"""
Call func for every specific function instance. If this is not a
signature with fused types, call it with the entry for this cdef
function.
"""
entry
=
self
.
entry
def
map_with_specific_entries
(
entry
,
func
,
*
args
,
**
kwargs
):
"""
Call func for every specific function instance. If this is not a
signature with fused types, call it with the entry for this cdef
function.
"""
type
=
entry
.
type
if
type
.
is_cfunction
and
(
entry
.
fused_cfunction
or
type
.
is_fused
):
if
entry
.
fused_cfunction
:
# cdef with fused types defined in this file
for
cfunction
in
entry
.
fused_cfunction
.
nodes
:
func
(
cfunction
.
entry
,
*
args
,
**
kwargs
)
el
if
entry
.
type
.
is_fused
:
el
se
:
# cdef with fused types defined in another file, create their
# signatures
for
func_type
in
self
.
get_all_specific_function_types
():
for
func_type
in
type
.
get_all_specific_function_types
():
func
(
func_type
.
entry
,
*
args
,
**
kwargs
)
else
:
# a normal cdef
return
func
(
entry
,
*
args
,
**
kwargs
)
else
:
# a normal cdef or not a c function
func
(
entry
,
*
args
,
**
kwargs
)
def
get_all_specific_permutations
(
fused_types
,
id
=
"0"
,
f2s
=
()):
fused_type
=
fused_types
[
0
]
...
...
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