diff options
author | Mark Dickinson <dickinsm@gmail.com> | 2009-02-15 15:48:39 (GMT) |
---|---|---|
committer | Mark Dickinson <dickinsm@gmail.com> | 2009-02-15 15:48:39 (GMT) |
commit | bcf6b18eb721ac291599a26fba36cec4229cadce (patch) | |
tree | e28667255f280f9fa510970464778c311709aa33 /Objects/longobject.c | |
parent | 2ffb26fb83b4c559d1f4cd3a26cda6d7234e809d (diff) | |
download | cpython-bcf6b18eb721ac291599a26fba36cec4229cadce.zip cpython-bcf6b18eb721ac291599a26fba36cec4229cadce.tar.gz cpython-bcf6b18eb721ac291599a26fba36cec4229cadce.tar.bz2 |
A few more minor fixes in longobject.c
Diffstat (limited to 'Objects/longobject.c')
-rw-r--r-- | Objects/longobject.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c index af222de..6a5a724 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -63,7 +63,7 @@ long_normalize(register PyLongObject *v) PyLongObject * _PyLong_New(Py_ssize_t size) { - if (size > MAX_LONG_DIGITS) { + if (size > (Py_ssize_t)MAX_LONG_DIGITS) { PyErr_SetString(PyExc_OverflowError, "too many digits in integer"); return NULL; @@ -1945,7 +1945,7 @@ long_compare(PyLongObject *a, PyLongObject *b) if (i < 0) sign = 0; else { - sign = (int)a->ob_digit[i] - (int)b->ob_digit[i]; + sign = (sdigit)a->ob_digit[i] - (sdigit)b->ob_digit[i]; if (Py_SIZE(a) < 0) sign = -sign; } @@ -2865,7 +2865,7 @@ long_pow(PyObject *v, PyObject *w, PyObject *x) for (i = Py_SIZE(b) - 1; i >= 0; --i) { digit bi = b->ob_digit[i]; - for (j = 1 << (PyLong_SHIFT-1); j != 0; j >>= 1) { + for (j = (digit)1 << (PyLong_SHIFT-1); j != 0; j >>= 1) { MULT(z, z, z) if (bi & j) MULT(z, a, z) @@ -3099,9 +3099,8 @@ long_bitwise(PyLongObject *a, { digit maska, maskb; /* 0 or PyLong_MASK */ int negz; - Py_ssize_t size_a, size_b, size_z; + Py_ssize_t size_a, size_b, size_z, i; PyLongObject *z; - int i; digit diga, digb; PyObject *v; |