Commit d7c0331a authored by Stefan Behnel's avatar Stefan Behnel

Merge branch '0.23.x'

Conflicts:
	CHANGES.rst
	Cython/Shadow.py
parents 6fd4c512 e8199242
...@@ -57,7 +57,7 @@ Other changes ...@@ -57,7 +57,7 @@ Other changes
------------- -------------
0.23.3 (2015-??-??) 0.23.3 (2015-09-29)
=================== ===================
Bugs fixed Bugs fixed
......
...@@ -1238,7 +1238,15 @@ class IntNode(ConstNode): ...@@ -1238,7 +1238,15 @@ class IntNode(ConstNode):
self.result_code = self.get_constant_c_result_code() self.result_code = self.get_constant_c_result_code()
def get_constant_c_result_code(self): def get_constant_c_result_code(self):
return self.value_as_c_integer_string() + self.unsigned + self.longness unsigned, longness = self.unsigned, self.longness
literal = self.value_as_c_integer_string()
if not (unsigned or longness) and self.type.is_int and literal[0] == '-' and literal[1] != '0':
# negative decimal literal => guess longness from type to prevent wrap-around
if self.type.rank >= PyrexTypes.c_longlong_type.rank:
longness = 'LL'
elif self.type.rank >= PyrexTypes.c_long_type.rank:
longness = 'L'
return literal + unsigned + longness
def value_as_c_integer_string(self): def value_as_c_integer_string(self):
value = self.value value = self.value
......
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