Commit 387c5032 authored by scoder's avatar scoder Committed by GitHub

Merge pull request #2553 from gabrieldemarmiesse/line_lenght

Set the maximum line length to 150.
parents ba9ecff9 529dfc13
...@@ -2297,7 +2297,8 @@ class CCodeWriter(object): ...@@ -2297,7 +2297,8 @@ class CCodeWriter(object):
# error handling # error handling
def put_error_if_neg(self, pos, value): def put_error_if_neg(self, pos, value):
# return self.putln("if (unlikely(%s < 0)) %s" % (value, self.error_goto(pos))) # TODO this path is almost _never_ taken, yet this macro makes is slower! # TODO this path is almost _never_ taken, yet this macro makes is slower!
# return self.putln("if (unlikely(%s < 0)) %s" % (value, self.error_goto(pos)))
return self.putln("if (%s < 0) %s" % (value, self.error_goto(pos))) return self.putln("if (%s < 0) %s" % (value, self.error_goto(pos)))
def put_error_if_unbound(self, pos, entry, in_nogil_context=False): def put_error_if_unbound(self, pos, entry, in_nogil_context=False):
......
...@@ -5818,7 +5818,8 @@ class SimpleCallNode(CallNode): ...@@ -5818,7 +5818,8 @@ class SimpleCallNode(CallNode):
and self.type.is_int and self.type.is_int
and self.type.signed and self.type.signed
and self.function.result() in ('abs', 'labs', '__Pyx_abs_longlong')): and self.function.result() in ('abs', 'labs', '__Pyx_abs_longlong')):
goto_error = 'if (unlikely(%s < 0)) { PyErr_SetString(PyExc_OverflowError, "value too large"); %s; }' % (self.result(), code.error_goto(self.pos)) goto_error = 'if (unlikely(%s < 0)) { PyErr_SetString(PyExc_OverflowError, "value too large"); %s; }' % (
self.result(), code.error_goto(self.pos))
elif exc_checks: elif exc_checks:
goto_error = code.error_goto_if(" && ".join(exc_checks), self.pos) goto_error = code.error_goto_if(" && ".join(exc_checks), self.pos)
else: else:
......
...@@ -2237,7 +2237,9 @@ class CClassScope(ClassScope): ...@@ -2237,7 +2237,9 @@ class CClassScope(ClassScope):
# TODO(robertwb): Make this an error. # TODO(robertwb): Make this an error.
warning(pos, warning(pos,
"Compatible but non-identical C method '%s' not redeclared " "Compatible but non-identical C method '%s' not redeclared "
"in definition part of extension type '%s'. This may cause incorrect vtables to be generated." % (name, self.class_name), 2) "in definition part of extension type '%s'. "
"This may cause incorrect vtables to be generated." % (
name, self.class_name), 2)
warning(entry.pos, "Previous declaration is here", 2) warning(entry.pos, "Previous declaration is here", 2)
entry = self.add_cfunction(name, type, pos, cname, visibility='ignore', modifiers=modifiers) entry = self.add_cfunction(name, type, pos, cname, visibility='ignore', modifiers=modifiers)
else: else:
......
...@@ -20,7 +20,8 @@ def test_sizeof(): ...@@ -20,7 +20,8 @@ def test_sizeof():
""" """
x = cython.declare(cython.bint) x = cython.declare(cython.bint)
print(cython.sizeof(x) == cython.sizeof(cython.bint)) print(cython.sizeof(x) == cython.sizeof(cython.bint))
print(cython.sizeof(cython.char) <= cython.sizeof(cython.short) <= cython.sizeof(cython.int) <= cython.sizeof(cython.long) <= cython.sizeof(cython.longlong)) sizeof = cython.sizeof
print(sizeof(cython.char) <= sizeof(cython.short) <= sizeof(cython.int) <= sizeof(cython.long) <= sizeof(cython.longlong))
print(cython.sizeof(cython.uint) == cython.sizeof(cython.int)) print(cython.sizeof(cython.uint) == cython.sizeof(cython.int))
print(cython.sizeof(cython.p_int) == cython.sizeof(cython.p_double)) print(cython.sizeof(cython.p_int) == cython.sizeof(cython.p_double))
if cython.compiled: if cython.compiled:
......
...@@ -13,6 +13,6 @@ commands = ...@@ -13,6 +13,6 @@ commands =
[pycodestyle] [pycodestyle]
ignore = W, E ignore = W, E
select = E711, E714 select = E711, E714, E501
max-line-length = 300 max-line-length = 150
format = pylint format = pylint
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