[ctypes-commit] ctypes/source _ctypes.c,1.226.2.44,1.226.2.45 callproc.c,1.127.2.20,1.127.2.21 cfiel
Brought to you by:
theller
From: Thomas H. <th...@us...> - 2006-02-01 20:53:03
|
Update of /cvsroot/ctypes/ctypes/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19341/source Modified Files: Tag: branch_1_0 _ctypes.c callproc.c cfield.c stgdict.c Log Message: Patch from perky: use WORDS_BIGENDIAN from pyconfig.h, instead of inventing our own mechanism ro determine the byte order. Index: stgdict.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/stgdict.c,v retrieving revision 1.32.2.4 retrieving revision 1.32.2.5 diff -C2 -d -r1.32.2.4 -r1.32.2.5 *** stgdict.c 30 Nov 2005 09:34:21 -0000 1.32.2.4 --- stgdict.c 1 Feb 2006 20:52:50 -0000 1.32.2.5 *************** *** 194,198 **** return 0; ! #ifdef IS_BIG_ENDIAN big_endian = PyObject_HasAttrString(type, "_swappedbytes_") ? 0 : 1; #else --- 194,198 ---- return 0; ! #ifdef WORDS_BIGENDIAN big_endian = PyObject_HasAttrString(type, "_swappedbytes_") ? 0 : 1; #else Index: callproc.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/callproc.c,v retrieving revision 1.127.2.20 retrieving revision 1.127.2.21 diff -C2 -d -r1.127.2.20 -r1.127.2.21 *** callproc.c 12 Jan 2006 12:32:04 -0000 1.127.2.20 --- callproc.c 1 Feb 2006 20:52:49 -0000 1.127.2.21 *************** *** 938,942 **** goto cleanup; ! #if IS_BIG_ENDIAN /* libffi returns the result in a buffer with sizeof(ffi_arg). This causes problems on big endian machines, since the result buffer --- 938,942 ---- goto cleanup; ! #if WORDS_BIGENDIAN /* libffi returns the result in a buffer with sizeof(ffi_arg). This causes problems on big endian machines, since the result buffer Index: cfield.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/cfield.c,v retrieving revision 1.74.2.16 retrieving revision 1.74.2.17 diff -C2 -d -r1.74.2.16 -r1.74.2.17 *** cfield.c 30 Dec 2005 17:22:47 -0000 1.74.2.16 --- cfield.c 1 Feb 2006 20:52:50 -0000 1.74.2.17 *************** *** 916,920 **** return NULL; } ! #ifdef IS_BIG_ENDIAN if (_PyFloat_Pack8(x, (unsigned char *)ptr, 1)) return NULL; --- 916,920 ---- return NULL; } ! #ifdef WORDS_BIGENDIAN if (_PyFloat_Pack8(x, (unsigned char *)ptr, 1)) return NULL; *************** *** 929,933 **** d_get_sw(void *ptr, unsigned size) { ! #ifdef IS_BIG_ENDIAN return PyFloat_FromDouble(_PyFloat_Unpack8(ptr, 1)); #else --- 929,933 ---- d_get_sw(void *ptr, unsigned size) { ! #ifdef WORDS_BIGENDIAN return PyFloat_FromDouble(_PyFloat_Unpack8(ptr, 1)); #else *************** *** 970,974 **** return NULL; } ! #ifdef IS_BIG_ENDIAN if (_PyFloat_Pack4(x, (unsigned char *)ptr, 1)) return NULL; --- 970,974 ---- return NULL; } ! #ifdef WORDS_BIGENDIAN if (_PyFloat_Pack4(x, (unsigned char *)ptr, 1)) return NULL; *************** *** 983,987 **** f_get_sw(void *ptr, unsigned size) { ! #ifdef IS_BIG_ENDIAN return PyFloat_FromDouble(_PyFloat_Unpack4(ptr, 1)); #else --- 983,987 ---- f_get_sw(void *ptr, unsigned size) { ! #ifdef WORDS_BIGENDIAN return PyFloat_FromDouble(_PyFloat_Unpack4(ptr, 1)); #else Index: _ctypes.c =================================================================== RCS file: /cvsroot/ctypes/ctypes/source/_ctypes.c,v retrieving revision 1.226.2.44 retrieving revision 1.226.2.45 diff -C2 -d -r1.226.2.44 -r1.226.2.45 *** _ctypes.c 17 Jan 2006 14:55:59 -0000 1.226.2.44 --- _ctypes.c 1 Feb 2006 20:52:49 -0000 1.226.2.45 *************** *** 1247,1251 **** if (suffix == NULL) ! #ifdef IS_BIG_ENDIAN suffix = PyString_FromString("_le"); #else --- 1247,1251 ---- if (suffix == NULL) ! #ifdef WORDS_BIGENDIAN suffix = PyString_FromString("_le"); #else *************** *** 1417,1421 **** return NULL; } ! #ifdef IS_BIG_ENDIAN PyObject_SetAttrString((PyObject *)result, "__ctype_le__", swapped); PyObject_SetAttrString((PyObject *)result, "__ctype_be__", (PyObject *)result); --- 1417,1421 ---- return NULL; } ! #ifdef WORDS_BIGENDIAN PyObject_SetAttrString((PyObject *)result, "__ctype_le__", swapped); PyObject_SetAttrString((PyObject *)result, "__ctype_be__", (PyObject *)result); |