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
73e6ab4a
Commit
73e6ab4a
authored
Nov 06, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved string.h utility code over to Builtin.py to make it generally available to other modules
parent
e35445d1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
+8
-9
Cython/Compiler/Builtin.py
Cython/Compiler/Builtin.py
+6
-0
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+2
-9
No files found.
Cython/Compiler/Builtin.py
View file @
73e6ab4a
...
...
@@ -160,6 +160,12 @@ proto = """
#define __Pyx_PyNumber_Power2(a, b) PyNumber_Power(a, b, Py_None)
"""
)
include_string_h_utility_code
=
UtilityCode
(
proto
=
"""
#include <string.h>
"""
)
iter_next_utility_code
=
UtilityCode
(
proto
=
"""
#define __Pyx_PyIter_Next(obj) __Pyx_PyIter_Next2(obj, NULL);
...
...
Cython/Compiler/Optimize.py
View file @
73e6ab4a
...
...
@@ -1854,7 +1854,7 @@ class OptimizeBuiltinCalls(Visitor.EnvTransform):
node
.
pos
,
"strlen"
,
self
.
Pyx_strlen_func_type
,
args
=
[
arg
],
is_temp
=
node
.
is_temp
,
utility_code
=
include_string_h_utility_code
)
utility_code
=
Builtin
.
include_string_h_utility_code
)
elif
arg
.
type
.
is_pyobject
:
cfunc_name
=
self
.
_map_to_capi_len_function
(
arg
.
type
)
if
cfunc_name
is
None
:
...
...
@@ -2514,7 +2514,7 @@ class OptimizeBuiltinCalls(Visitor.EnvTransform):
string_node
.
pos
,
"strlen"
,
self
.
Pyx_strlen_func_type
,
args
=
[
string_node
],
is_temp
=
False
,
utility_code
=
include_string_h_utility_code
,
utility_code
=
Builtin
.
include_string_h_utility_code
,
).
coerce_to
(
PyrexTypes
.
c_py_ssize_t_type
,
self
.
current_env
())
elif
start
:
stop
=
ExprNodes
.
SubNode
(
...
...
@@ -2894,13 +2894,6 @@ static CYTHON_INLINE char __Pyx_PyBytes_GetItemInt(PyObject* bytes, Py_ssize_t i
)
include_string_h_utility_code
=
UtilityCode
(
proto
=
"""
#include <string.h>
"""
)
tpnew_utility_code
=
UtilityCode
(
proto
=
"""
static CYTHON_INLINE PyObject* __Pyx_tp_new(PyObject* type_obj) {
...
...
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