diff options
author | Stefan Krah <stefan@bytereef.org> | 2010-04-07 08:49:55 (GMT) |
---|---|---|
committer | Stefan Krah <stefan@bytereef.org> | 2010-04-07 08:49:55 (GMT) |
commit | 0091e5ecd045b86560d5c1ccc6a33ec606967630 (patch) | |
tree | 22b34094b3a0cd23e84f43b85e23b2d168f24b86 /Objects/longobject.c | |
parent | a9aedd2011f6ab83215738e5214cbd6e484ca754 (diff) | |
download | cpython-0091e5ecd045b86560d5c1ccc6a33ec606967630.zip cpython-0091e5ecd045b86560d5c1ccc6a33ec606967630.tar.gz cpython-0091e5ecd045b86560d5c1ccc6a33ec606967630.tar.bz2 |
Merged revisions 79885 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r79885 | stefan.krah | 2010-04-07 10:24:44 +0200 (Wed, 07 Apr 2010) | 1 line
Issue #8328: Silence Visual Studio warnings.
........
Diffstat (limited to 'Objects/longobject.c')
-rw-r--r-- | Objects/longobject.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c index 2b5328d..13e9721 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -1111,7 +1111,7 @@ PyLong_FromSize_t(size_t ival) int ndigits = 0; if (ival < PyLong_BASE) - return PyLong_FromLong(ival); + return PyLong_FromLong((long)ival); /* Count the number of Python digits. */ t = ival; while (t) { @@ -2405,7 +2405,7 @@ _PyLong_Frexp(PyLongObject *a, Py_ssize_t *e) while (x_size < shift_digits) x_digits[x_size++] = 0; rem = v_lshift(x_digits + x_size, a->ob_digit, a_size, - shift_bits); + (int)shift_bits); x_size += a_size; x_digits[x_size++] = rem; } @@ -2413,7 +2413,7 @@ _PyLong_Frexp(PyLongObject *a, Py_ssize_t *e) shift_digits = (a_bits - DBL_MANT_DIG - 2) / PyLong_SHIFT; shift_bits = (a_bits - DBL_MANT_DIG - 2) % PyLong_SHIFT; rem = v_rshift(x_digits, a->ob_digit + shift_digits, - a_size - shift_digits, shift_bits); + a_size - shift_digits, (int)shift_bits); x_size = a_size - shift_digits; /* For correct rounding below, we need the least significant bit of x to be 'sticky' for this shift: if any of the bits @@ -2475,7 +2475,7 @@ PyLong_AsDouble(PyObject *v) "long int too large to convert to float"); return -1.0; } - return ldexp(x, exponent); + return ldexp(x, (int)exponent); } /* Methods */ @@ -3492,9 +3492,9 @@ long_true_divide(PyObject *v, PyObject *w) /* Check whether ldexp result will overflow a double. */ if (shift + x_bits >= DBL_MAX_EXP && - (shift + x_bits > DBL_MAX_EXP || dx == ldexp(1.0, x_bits))) + (shift + x_bits > DBL_MAX_EXP || dx == ldexp(1.0, (int)x_bits))) goto overflow; - result = ldexp(dx, shift); + result = ldexp(dx, (int)shift); success: return PyFloat_FromDouble(negate ? -result : result); @@ -4362,7 +4362,7 @@ long_bit_length(PyLongObject *v) Py_DECREF(result); result = y; - x = (PyLongObject *)PyLong_FromLong(msd_bits); + x = (PyLongObject *)PyLong_FromLong((long)msd_bits); if (x == NULL) goto error; y = (PyLongObject *)long_add(result, x); |