Commit 6ab88618 authored by Stefan Behnel's avatar Stefan Behnel

suppress C compiler warning on power operation on unsigned C int types

parent 311c0f08
...@@ -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 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment