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
Boxiang Sun
cython
Commits
e8446db5
Commit
e8446db5
authored
Mar 20, 2015
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
give utility function a more specific name
parent
b4f3280c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
Cython/Compiler/Optimize.py
Cython/Compiler/Optimize.py
+4
-4
Cython/Utility/Optimize.c
Cython/Utility/Optimize.c
+4
-4
No files found.
Cython/Compiler/Optimize.py
View file @
e8446db5
...
...
@@ -2780,7 +2780,7 @@ class OptimizeBuiltinCalls(Visitor.NodeRefCleanupMixin,
may_return_none
=
True
,
utility_code
=
load_c_utility
(
'dict_setdefault'
))
Pyx_Py
Number
_BinopInt_func_type
=
PyrexTypes
.
CFuncType
(
Pyx_Py
Int
_BinopInt_func_type
=
PyrexTypes
.
CFuncType
(
PyrexTypes
.
py_object_type
,
[
PyrexTypes
.
CFuncTypeArg
(
"op1"
,
PyrexTypes
.
py_object_type
,
None
),
PyrexTypes
.
CFuncTypeArg
(
"op2"
,
PyrexTypes
.
py_object_type
,
None
),
...
...
@@ -2826,12 +2826,12 @@ class OptimizeBuiltinCalls(Visitor.NodeRefCleanupMixin,
self
.
_inject_int_default_argument
(
node
,
args
,
len
(
args
),
PyrexTypes
.
c_long_type
,
int
(
inplace
))
utility_code
=
TempitaUtilityCode
.
load_cached
(
"Py
Number
BinopWithInt"
,
"Optimize.c"
,
"Py
Int
BinopWithInt"
,
"Optimize.c"
,
context
=
dict
(
op
=
operator
,
order
=
arg_order
))
return
self
.
_substitute_method_call
(
node
,
function
,
"__Pyx_Py
Number
_%s%s"
%
(
operator
,
arg_order
),
self
.
Pyx_Py
Number
_BinopInt_func_type
,
node
,
function
,
"__Pyx_Py
Int
_%s%s"
%
(
operator
,
arg_order
),
self
.
Pyx_Py
Int
_BinopInt_func_type
,
'__%s__'
%
operator
[:
3
].
lower
(),
is_unbound_method
,
args
,
may_return_none
=
True
,
with_none_check
=
False
,
...
...
Cython/Utility/Optimize.c
View file @
e8446db5
...
...
@@ -479,16 +479,16 @@ fallback:
}
/////////////// Py
Number
BinopWithInt.proto ///////////////
/////////////// Py
Int
BinopWithInt.proto ///////////////
static
PyObject
*
__Pyx_Py
Number
_
{{
op
}}{{
order
}}(
PyObject
*
op1
,
PyObject
*
op2
,
long
intval
,
int
inplace
);
/*proto*/
static
PyObject
*
__Pyx_Py
Int
_
{{
op
}}{{
order
}}(
PyObject
*
op1
,
PyObject
*
op2
,
long
intval
,
int
inplace
);
/*proto*/
/////////////// Py
Number
BinopWithInt ///////////////
/////////////// Py
Int
BinopWithInt ///////////////
//@requires: TypeConversion.c::PyLongInternals
{{
py
:
pyval
,
ival
=
(
'
op2
'
,
'b'
)
if
order
==
'
IntObj
'
else
(
'
op1
'
,
'a'
)
}}
static
PyObject
*
__Pyx_Py
Number
_
{{
op
}}{{
order
}}(
PyObject
*
op1
,
PyObject
*
op2
,
CYTHON_UNUSED
long
intval
,
int
inplace
)
{
static
PyObject
*
__Pyx_Py
Int
_
{{
op
}}{{
order
}}(
PyObject
*
op1
,
PyObject
*
op2
,
CYTHON_UNUSED
long
intval
,
int
inplace
)
{
#if CYTHON_COMPILING_IN_CPYTHON
const
long
{{
'a'
if
order
==
'
IntObj
'
else
'b'
}}
=
intval
;
...
...
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