]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Change IS_LITTLE_ENDIAN macro -- a little faster now.
authorTim Peters <tim.peters@gmail.com>
Thu, 14 Jun 2001 18:42:50 +0000 (18:42 +0000)
committerTim Peters <tim.peters@gmail.com>
Thu, 14 Jun 2001 18:42:50 +0000 (18:42 +0000)
Objects/longobject.c

index 250db7c5ccaff6c52b8d12c332a9221d346eccd5..be9430ad0739a3af647d20a0b5d14398d8de4fbb 100644 (file)
@@ -562,7 +562,7 @@ PyLong_AsVoidPtr(PyObject *vv)
  * rewritten to use the newer PyLong_{As,From}ByteArray API.
  */
 
-#define IS_LITTLE_ENDIAN *(char*)&one != '\0'
+#define IS_LITTLE_ENDIAN (int)*(unsigned char*)&one
 
 /* Create a new long int object from a C LONG_LONG int. */