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
6ab88618
Commit
6ab88618
authored
Jan 20, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
suppress C compiler warning on power operation on unsigned C int types
parent
311c0f08
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+6
-2
No files found.
Cython/Compiler/ExprNodes.py
View file @
6ab88618
...
@@ -8438,8 +8438,10 @@ class PowNode(NumBinopNode):
...
@@ -8438,8 +8438,10 @@ class PowNode(NumBinopNode):
else
:
else
:
self
.
pow_func
=
"__Pyx_pow_%s"
%
self
.
type
.
declaration_code
(
''
).
replace
(
' '
,
'_'
)
self
.
pow_func
=
"__Pyx_pow_%s"
%
self
.
type
.
declaration_code
(
''
).
replace
(
' '
,
'_'
)
env
.
use_utility_code
(
env
.
use_utility_code
(
int_pow_utility_code
.
specialize
(
func_name
=
self
.
pow_func
,
int_pow_utility_code
.
specialize
(
type
=
self
.
type
.
declaration_code
(
''
)))
func_name
=
self
.
pow_func
,
type
=
self
.
type
.
declaration_code
(
''
),
signed
=
self
.
type
.
signed
and
1
or
0
))
def
calculate_result_code
(
self
):
def
calculate_result_code
(
self
):
# Work around MSVC overloading ambiguity.
# Work around MSVC overloading ambiguity.
...
@@ -10055,7 +10057,9 @@ static CYTHON_INLINE %(type)s %(func_name)s(%(type)s b, %(type)s e) {
...
@@ -10055,7 +10057,9 @@ static CYTHON_INLINE %(type)s %(func_name)s(%(type)s b, %(type)s e) {
case 0:
case 0:
return 1;
return 1;
}
}
#if %(signed)s
if (unlikely(e<0)) return 0;
if (unlikely(e<0)) return 0;
#endif
t = 1;
t = 1;
while (likely(e)) {
while (likely(e)) {
t *= (b * (e&1)) | ((~e)&1); /* 1 or b */
t *= (b * (e&1)) | ((~e)&1); /* 1 or b */
...
...
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