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
e8fb800c
Commit
e8fb800c
authored
Dec 11, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up IntNode() instantiation
parent
c349b076
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+1
-1
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+5
-5
No files found.
Cython/Compiler/ExprNodes.py
View file @
e8fb800c
...
...
@@ -8463,7 +8463,7 @@ class CythonArrayNode(ExprNode):
if
axis
.
stop
.
is_none
:
if
array_dimension_sizes
:
dimsize
=
array_dimension_sizes
[
axis_no
]
axis
.
stop
=
IntNode
(
self
.
pos
,
value
=
dimsize
,
axis
.
stop
=
IntNode
(
self
.
pos
,
value
=
str
(
dimsize
)
,
constant_result
=
dimsize
,
type
=
PyrexTypes
.
c_int_type
)
else
:
...
...
Cython/Compiler/Optimize.py
View file @
e8fb800c
...
...
@@ -301,7 +301,7 @@ class IterationTransform(Visitor.EnvTransform):
PyrexTypes
.
c_uchar_ptr_type
,
self
.
current_env
()),
start
=
None
,
stop
=
ExprNodes
.
IntNode
(
slice_node
.
pos
,
value
=
len
(
bytes_value
),
slice_node
.
pos
,
value
=
str
(
len
(
bytes_value
)
),
constant_result
=
len
(
bytes_value
),
type
=
PyrexTypes
.
c_py_ssize_t_type
),
type
=
Builtin
.
unicode_type
,
# hint for Python conversion
...
...
@@ -2205,15 +2205,15 @@ class OptimizeBuiltinCalls(Visitor.MethodDispatcherTransform):
elif
isinstance
(
arg
,
ExprNodes
.
UnicodeNode
):
if
len
(
arg
.
value
)
==
1
:
return
ExprNodes
.
IntNode
(
ord
(
arg
.
value
)
,
type
=
PyrexTypes
.
c_int_type
,
arg
.
pos
,
type
=
PyrexTypes
.
c_int_type
,
value
=
str
(
ord
(
arg
.
value
)),
constant_result
=
ord
(
arg
.
value
)
).
coerce_to
(
node
.
type
,
self
.
current_env
())
elif
isinstance
(
arg
,
ExprNodes
.
StringNode
):
if
arg
.
unicode_value
and
len
(
arg
.
unicode_value
)
==
1
\
and
ord
(
arg
.
unicode_value
)
<=
255
:
# Py2/3 portability
and
ord
(
arg
.
unicode_value
)
<=
255
:
# Py2/3 portability
return
ExprNodes
.
IntNode
(
ord
(
arg
.
unicode_value
)
,
type
=
PyrexTypes
.
c_int_type
,
arg
.
pos
,
type
=
PyrexTypes
.
c_int_type
,
value
=
str
(
ord
(
arg
.
unicode_value
)),
constant_result
=
ord
(
arg
.
unicode_value
)
).
coerce_to
(
node
.
type
,
self
.
current_env
())
...
...
@@ -2441,7 +2441,7 @@ class OptimizeBuiltinCalls(Visitor.MethodDispatcherTransform):
else
:
is_safe_type
=
0
# definitely not
args
.
append
(
ExprNodes
.
IntNode
(
node
.
pos
,
value
=
is_safe_type
,
constant_result
=
is_safe_type
))
node
.
pos
,
value
=
str
(
is_safe_type
)
,
constant_result
=
is_safe_type
))
return
self
.
_substitute_method_call
(
node
,
function
,
...
...
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