]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
PyLong_As{Unsigned,}LongLong: fiddled final result casting.
authorTim Peters <tim.peters@gmail.com>
Wed, 13 Jun 2001 20:45:17 +0000 (20:45 +0000)
committerTim Peters <tim.peters@gmail.com>
Wed, 13 Jun 2001 20:45:17 +0000 (20:45 +0000)
Objects/longobject.c

index 615d497632cd85a3085de1c880a18282b08a2f43..3c22470fb0d1cd041fa9298455f3603b0400739f 100644 (file)
@@ -572,7 +572,7 @@ PyLong_AsLongLong(PyObject *vv)
                        (PyLongObject *)vv, (unsigned char *)&bytes,
                        SIZEOF_LONG_LONG, IS_LITTLE_ENDIAN, 1);
 
-       return (LONG_LONG)(res < 0 ? res : bytes);
+       return res < 0 ? (LONG_LONG)res : bytes;
 }
 
 /* Get a C unsigned LONG_LONG int from a long int object.
@@ -594,7 +594,7 @@ PyLong_AsUnsignedLongLong(PyObject *vv)
                        (PyLongObject *)vv, (unsigned char *)&bytes,
                        SIZEOF_LONG_LONG, IS_LITTLE_ENDIAN, 0);
 
-       return (unsigned LONG_LONG)(res < 0 ? res : bytes);
+       return res < 0 ? (unsigned LONG_LONG)res : bytes;
 }
 
 #undef IS_LITTLE_ENDIAN