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
Kirill Smelkov
cython
Commits
49d90c94
Commit
49d90c94
authored
Jul 15, 2014
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into static
Conflicts: CHANGES.rst Cython/Compiler/Nodes.py
parents
96416479
9610ed34
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
3 deletions
+22
-3
CHANGES.rst
CHANGES.rst
+2
-0
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+1
-1
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+7
-0
Cython/Includes/libcpp/__init__.pxd
Cython/Includes/libcpp/__init__.pxd
+0
-2
Cython/Includes/libcpp/cast.pxd
Cython/Includes/libcpp/cast.pxd
+12
-0
No files found.
CHANGES.rst
View file @
49d90c94
...
...
@@ -45,6 +45,8 @@ Features added
* New directive ``use_switch`` (defaults to True) to optionally disable
the optimization of chained if statement to C switch statements.
* Defines dynamic_cast et al. in `libcpp.cast`.
Optimizations
-------------
...
...
Cython/Compiler/ExprNodes.py
View file @
49d90c94
...
...
@@ -5322,7 +5322,7 @@ class AttributeNode(ExprNode):
else
:
# Create a temporary entry describing the C method
# as an ordinary function.
if
entry
.
func_cname
:
if
entry
.
func_cname
and
not
hasattr
(
entry
.
type
,
'op_arg_struct'
)
:
cname
=
entry
.
func_cname
if
entry
.
type
.
is_static_method
:
ctype
=
entry
.
type
...
...
Cython/Compiler/Nodes.py
View file @
49d90c94
...
...
@@ -2145,6 +2145,7 @@ class CFuncDefNode(FuncDefNode):
# template_declaration String or None Used for c++ class methods
# is_const_method whether this is a const method
# is_static_method whether this is a static method
# is_c_class_method whether this is a cclass method
child_attrs
=
[
"base_type"
,
"declarator"
,
"body"
,
"py_func_stat"
]
...
...
@@ -2161,6 +2162,7 @@ class CFuncDefNode(FuncDefNode):
return
self
.
entry
.
name
def
analyse_declarations
(
self
,
env
):
self
.
is_c_class_method
=
env
.
is_c_class_scope
if
self
.
directive_locals
is
None
:
self
.
directive_locals
=
{}
self
.
directive_locals
.
update
(
env
.
directives
[
'locals'
])
...
...
@@ -2401,8 +2403,13 @@ class CFuncDefNode(FuncDefNode):
header
=
self
.
return_type
.
declaration_code
(
entity
,
dll_linkage
=
dll_linkage
)
#print (storage_class, modifiers, header)
needs_proto
=
self
.
is_c_class_method
if
self
.
template_declaration
:
if
needs_proto
:
code
.
globalstate
.
parts
[
'module_declarations'
].
putln
(
self
.
template_declaration
)
code
.
putln
(
self
.
template_declaration
)
if
needs_proto
:
code
.
globalstate
.
parts
[
'module_declarations'
].
putln
(
"%s%s%s; /* proto*/"
%
(
storage_class
,
modifiers
,
header
))
code
.
putln
(
"%s%s%s {"
%
(
storage_class
,
modifiers
,
header
))
def
generate_argument_declarations
(
self
,
env
,
code
):
...
...
Cython/Includes/libcpp/__init__.pxd
View file @
49d90c94
# empty file
cdef
extern
from
*
:
ctypedef
bint
bool
Cython/Includes/libcpp/cast.pxd
0 → 100644
View file @
49d90c94
# Defines the standard C++ cast operators.
#
# Due to type restrictions, these are only defined for pointer parameters,
# however that is the only case where they are significantly more interesting
# than the standard C cast operator which can be written "<T>(expression)" in
# Cython.
cdef
extern
from
*
:
cdef
T
dynamic_cast
[
T
](
void
*
)
except
+
# nullptr may also indicate failure
cdef
T
static_cast
[
T
](
void
*
)
cdef
T
reinterpret_cast
[
T
](
void
*
)
cdef
T
const_cast
[
T
](
void
*
)
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