summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrushing <gitsam@rushing.nightmare.com>2014-10-14 19:57:14 -0700
committerrushing <gitsam@rushing.nightmare.com>2014-10-14 19:57:14 -0700
commit0fef19491251d7edee491dc44ef4616ca17f8dad (patch)
tree94c21d14ddca43a6e35bf3bc14d9086ca339260f
parent9b1d6e2a1e52ba06a22c06f82c12a43bab6c1e0c (diff)
downloadcython-0fef19491251d7edee491dc44ef4616ca17f8dad.tar.gz
avoid LLVM warning: skip ternary operator when value is unsigned (-Wtautological-compare).
--HG-- extra : transplant_source : %87%E8%C9%0A%B8%1A%C34%26H%B8%0F%89%D4%8CC%10%1A%0F%84
-rw-r--r--Cython/Compiler/ExprNodes.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py
index 29fa1d094..1b924ae12 100644
--- a/Cython/Compiler/ExprNodes.py
+++ b/Cython/Compiler/ExprNodes.py
@@ -6021,8 +6021,10 @@ class SequenceNode(ExprNode):
if isinstance(mult_factor.constant_result, (int,long)) \
and mult_factor.constant_result > 0:
size_factor = ' * %s' % mult_factor.constant_result
- else:
+ elif mult_factor.type.signed:
size_factor = ' * ((%s<0) ? 0:%s)' % (c_mult, c_mult)
+ else:
+ size_factor = ' * (%s)' % (c_mult,)
if self.type is Builtin.tuple_type and (self.is_literal or self.slow) and not c_mult:
# use PyTuple_Pack() to avoid generating huge amounts of one-time code