[Python-checkins] python/dist/src/Modules _testcapimodule.c,1.19,1.20 addrinfo.h,1.4,1.5 bz2module.c,1.15,1.16 posixmodule.c,2.293,2.294 resource.c,2.28,2.29 socketmodule.c,1.257,1.258 structmodule.c,2.59,2.60

loewis@users.sourceforge.net loewis@users.sourceforge.net
Sat, 29 Mar 2003 02:04:57 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1:/tmp/cvs-serv28047/Modules

Modified Files:
	_testcapimodule.c addrinfo.h bz2module.c posixmodule.c 
	resource.c socketmodule.c structmodule.c 
Log Message:
Rename LONG_LONG to PY_LONG_LONG. Fixes #710285.


Index: _testcapimodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_testcapimodule.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** _testcapimodule.c	31 Jan 2003 15:52:04 -0000	1.19
--- _testcapimodule.c	29 Mar 2003 10:04:54 -0000	1.20
***************
*** 57,61 ****
  	CHECK_SIZEOF(SIZEOF_TIME_T, time_t);
  #ifdef HAVE_LONG_LONG
! 	CHECK_SIZEOF(SIZEOF_LONG_LONG, LONG_LONG);
  #endif
  
--- 57,61 ----
  	CHECK_SIZEOF(SIZEOF_TIME_T, time_t);
  #ifdef HAVE_LONG_LONG
! 	CHECK_SIZEOF(SIZEOF_LONG_LONG, PY_LONG_LONG);
  #endif
  
***************
*** 173,177 ****
     Note that the meat of the test is contained in testcapi_long.h.
     This is revolting, but delicate code duplication is worse:  "almost
!    exactly the same" code is needed to test LONG_LONG, but the ubiquitous
     dependence on type names makes it impossible to use a parameterized
     function.  A giant macro would be even worse than this.  A C++ template
--- 173,177 ----
     Note that the meat of the test is contained in testcapi_long.h.
     This is revolting, but delicate code duplication is worse:  "almost
!    exactly the same" code is needed to test PY_LONG_LONG, but the ubiquitous
     dependence on type names makes it impossible to use a parameterized
     function.  A giant macro would be even worse than this.  A C++ template
***************
*** 222,226 ****
  
  #define TESTNAME	test_longlong_api_inner
! #define TYPENAME	LONG_LONG
  #define F_S_TO_PY	PyLong_FromLongLong
  #define F_PY_TO_S	PyLong_AsLongLong
--- 222,226 ----
  
  #define TESTNAME	test_longlong_api_inner
! #define TYPENAME	PY_LONG_LONG
  #define F_S_TO_PY	PyLong_FromLongLong
  #define F_PY_TO_S	PyLong_AsLongLong
***************
*** 243,247 ****
  #undef F_PY_TO_U
  
! /* Test the L code for PyArg_ParseTuple.  This should deliver a LONG_LONG
     for both long and int arguments.  The test may leak a little memory if
     it fails.
--- 243,247 ----
  #undef F_PY_TO_U
  
! /* Test the L code for PyArg_ParseTuple.  This should deliver a PY_LONG_LONG
     for both long and int arguments.  The test may leak a little memory if
     it fails.
***************
*** 251,255 ****
  {
  	PyObject *tuple, *num;
! 	LONG_LONG value;
  
          tuple = PyTuple_New(1);
--- 251,255 ----
  {
  	PyObject *tuple, *num;
! 	PY_LONG_LONG value;
  
          tuple = PyTuple_New(1);

Index: addrinfo.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/addrinfo.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** addrinfo.h	6 Dec 2001 19:04:35 -0000	1.4
--- addrinfo.h	29 Mar 2003 10:04:54 -0000	1.5
***************
*** 143,147 ****
  #define _SS_MAXSIZE	128
  #ifdef HAVE_LONG_LONG
! #define _SS_ALIGNSIZE	(sizeof(LONG_LONG))
  #else
  #define _SS_ALIGNSIZE	(sizeof(double))
--- 143,147 ----
  #define _SS_MAXSIZE	128
  #ifdef HAVE_LONG_LONG
! #define _SS_ALIGNSIZE	(sizeof(PY_LONG_LONG))
  #else
  #define _SS_ALIGNSIZE	(sizeof(double))
***************
*** 160,164 ****
  	char	__ss_pad1[_SS_PAD1SIZE];
  #ifdef HAVE_LONG_LONG
! 	LONG_LONG __ss_align;	/* force desired structure storage alignment */
  #else
  	double __ss_align;	/* force desired structure storage alignment */
--- 160,164 ----
  	char	__ss_pad1[_SS_PAD1SIZE];
  #ifdef HAVE_LONG_LONG
! 	PY_LONG_LONG __ss_align;	/* force desired structure storage alignment */
  #else
  	double __ss_align;	/* force desired structure storage alignment */

Index: bz2module.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/bz2module.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** bz2module.c	11 Feb 2003 18:46:19 -0000	1.15
--- bz2module.c	29 Mar 2003 10:04:54 -0000	1.16
***************
*** 37,41 ****
  #elif SIZEOF_LONG_LONG >= 8
  #define BZS_TOTAL_OUT(bzs) \
! 	(((LONG_LONG)bzs->total_out_hi32 << 32) + bzs->total_out_lo32)
  #else
  #define BZS_TOTAL_OUT(bzs) \
--- 37,41 ----
  #elif SIZEOF_LONG_LONG >= 8
  #define BZS_TOTAL_OUT(bzs) \
! 	(((PY_LONG_LONG)bzs->total_out_hi32 << 32) + bzs->total_out_lo32)
  #else
  #define BZS_TOTAL_OUT(bzs) \
***************
*** 1491,1495 ****
  	int datasize;
  	int bufsize = SMALLCHUNK;
! 	LONG_LONG totalout;
  	PyObject *ret = NULL;
  	bz_stream *bzs = &self->bzs;
--- 1491,1495 ----
  	int datasize;
  	int bufsize = SMALLCHUNK;
! 	PY_LONG_LONG totalout;
  	PyObject *ret = NULL;
  	bz_stream *bzs = &self->bzs;
***************
*** 1563,1567 ****
  	PyObject *ret = NULL;
  	bz_stream *bzs = &self->bzs;
! 	LONG_LONG totalout;
  	int bzerror;
  
--- 1563,1567 ----
  	PyObject *ret = NULL;
  	bz_stream *bzs = &self->bzs;
! 	PY_LONG_LONG totalout;
  	int bzerror;
  
***************
*** 1769,1773 ****
  	int datasize;
  	int bufsize = SMALLCHUNK;
! 	LONG_LONG totalout;
  	PyObject *ret = NULL;
  	bz_stream *bzs = &self->bzs;
--- 1769,1773 ----
  	int datasize;
  	int bufsize = SMALLCHUNK;
! 	PY_LONG_LONG totalout;
  	PyObject *ret = NULL;
  	bz_stream *bzs = &self->bzs;

Index: posixmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v
retrieving revision 2.293
retrieving revision 2.294
diff -C2 -d -r2.293 -r2.294
*** posixmodule.c	21 Mar 2003 03:08:31 -0000	2.293
--- posixmodule.c	29 Mar 2003 10:04:54 -0000	2.294
***************
*** 892,896 ****
  	PyObject *fval,*ival;
  #if SIZEOF_TIME_T > SIZEOF_LONG
! 	ival = PyLong_FromLongLong((LONG_LONG)sec);
  #else
  	ival = PyInt_FromLong((long)sec);
--- 892,896 ----
  	PyObject *fval,*ival;
  #if SIZEOF_TIME_T > SIZEOF_LONG
! 	ival = PyLong_FromLongLong((PY_LONG_LONG)sec);
  #else
  	ival = PyInt_FromLong((long)sec);
***************
*** 919,923 ****
  #ifdef HAVE_LARGEFILE_SUPPORT
          PyStructSequence_SET_ITEM(v, 1,
! 				  PyLong_FromLongLong((LONG_LONG)st.st_ino));
  #else
          PyStructSequence_SET_ITEM(v, 1, PyInt_FromLong((long)st.st_ino));
--- 919,923 ----
  #ifdef HAVE_LARGEFILE_SUPPORT
          PyStructSequence_SET_ITEM(v, 1,
! 				  PyLong_FromLongLong((PY_LONG_LONG)st.st_ino));
  #else
          PyStructSequence_SET_ITEM(v, 1, PyInt_FromLong((long)st.st_ino));
***************
*** 925,929 ****
  #if defined(HAVE_LONG_LONG) && !defined(MS_WINDOWS)
          PyStructSequence_SET_ITEM(v, 2,
! 				  PyLong_FromLongLong((LONG_LONG)st.st_dev));
  #else
          PyStructSequence_SET_ITEM(v, 2, PyInt_FromLong((long)st.st_dev));
--- 925,929 ----
  #if defined(HAVE_LONG_LONG) && !defined(MS_WINDOWS)
          PyStructSequence_SET_ITEM(v, 2,
! 				  PyLong_FromLongLong((PY_LONG_LONG)st.st_dev));
  #else
          PyStructSequence_SET_ITEM(v, 2, PyInt_FromLong((long)st.st_dev));
***************
*** 934,938 ****
  #ifdef HAVE_LARGEFILE_SUPPORT
          PyStructSequence_SET_ITEM(v, 6,
! 				  PyLong_FromLongLong((LONG_LONG)st.st_size));
  #else
          PyStructSequence_SET_ITEM(v, 6, PyInt_FromLong(st.st_size));
--- 934,938 ----
  #ifdef HAVE_LARGEFILE_SUPPORT
          PyStructSequence_SET_ITEM(v, 6,
! 				  PyLong_FromLongLong((PY_LONG_LONG)st.st_size));
  #else
          PyStructSequence_SET_ITEM(v, 6, PyInt_FromLong(st.st_size));
***************
*** 2377,2381 ****
  		return Py_BuildValue("l", (long) spawnval);
  #else
! 		return Py_BuildValue("L", (LONG_LONG) spawnval);
  #endif
  }
--- 2377,2381 ----
  		return Py_BuildValue("l", (long) spawnval);
  #else
! 		return Py_BuildValue("L", (PY_LONG_LONG) spawnval);
  #endif
  }
***************
*** 2518,2522 ****
  		res = Py_BuildValue("l", (long) spawnval);
  #else
! 		res = Py_BuildValue("L", (LONG_LONG) spawnval);
  #endif
  
--- 2518,2522 ----
  		res = Py_BuildValue("l", (long) spawnval);
  #else
! 		res = Py_BuildValue("L", (PY_LONG_LONG) spawnval);
  #endif
  
***************
*** 5085,5089 ****
  	int fd, how;
  #if defined(MS_WIN64) || defined(MS_WINDOWS)
! 	LONG_LONG pos, res;
  #else
  	off_t pos, res;
--- 5085,5089 ----
  	int fd, how;
  #if defined(MS_WIN64) || defined(MS_WINDOWS)
! 	PY_LONG_LONG pos, res;
  #else
  	off_t pos, res;
***************
*** 5817,5831 ****
          PyStructSequence_SET_ITEM(v, 1, PyInt_FromLong((long) st.f_frsize));
          PyStructSequence_SET_ITEM(v, 2,
! 			       PyLong_FromLongLong((LONG_LONG) st.f_blocks));
          PyStructSequence_SET_ITEM(v, 3,
! 			       PyLong_FromLongLong((LONG_LONG) st.f_bfree));
          PyStructSequence_SET_ITEM(v, 4,
! 			       PyLong_FromLongLong((LONG_LONG) st.f_bavail));
          PyStructSequence_SET_ITEM(v, 5,
! 			       PyLong_FromLongLong((LONG_LONG) st.f_files));
          PyStructSequence_SET_ITEM(v, 6,
! 			       PyLong_FromLongLong((LONG_LONG) st.f_ffree));
          PyStructSequence_SET_ITEM(v, 7,
! 			       PyLong_FromLongLong((LONG_LONG) st.f_favail));
          PyStructSequence_SET_ITEM(v, 8, PyInt_FromLong((long) st.f_flag));
          PyStructSequence_SET_ITEM(v, 9, PyInt_FromLong((long) st.f_namemax));
--- 5817,5831 ----
          PyStructSequence_SET_ITEM(v, 1, PyInt_FromLong((long) st.f_frsize));
          PyStructSequence_SET_ITEM(v, 2,
! 			       PyLong_FromLongLong((PY_LONG_LONG) st.f_blocks));
          PyStructSequence_SET_ITEM(v, 3,
! 			       PyLong_FromLongLong((PY_LONG_LONG) st.f_bfree));
          PyStructSequence_SET_ITEM(v, 4,
! 			       PyLong_FromLongLong((PY_LONG_LONG) st.f_bavail));
          PyStructSequence_SET_ITEM(v, 5,
! 			       PyLong_FromLongLong((PY_LONG_LONG) st.f_files));
          PyStructSequence_SET_ITEM(v, 6,
! 			       PyLong_FromLongLong((PY_LONG_LONG) st.f_ffree));
          PyStructSequence_SET_ITEM(v, 7,
! 			       PyLong_FromLongLong((PY_LONG_LONG) st.f_favail));
          PyStructSequence_SET_ITEM(v, 8, PyInt_FromLong((long) st.f_flag));
          PyStructSequence_SET_ITEM(v, 9, PyInt_FromLong((long) st.f_namemax));

Index: resource.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/resource.c,v
retrieving revision 2.28
retrieving revision 2.29
diff -C2 -d -r2.28 -r2.29
*** resource.c	2 Nov 2002 17:46:24 -0000	2.28
--- resource.c	29 Mar 2003 10:04:54 -0000	2.29
***************
*** 129,134 ****
  	if (sizeof(rl.rlim_cur) > sizeof(long)) {
  		return Py_BuildValue("LL",
! 				     (LONG_LONG) rl.rlim_cur,
! 				     (LONG_LONG) rl.rlim_max);
  	}
  #endif
--- 129,134 ----
  	if (sizeof(rl.rlim_cur) > sizeof(long)) {
  		return Py_BuildValue("LL",
! 				     (PY_LONG_LONG) rl.rlim_cur,
! 				     (PY_LONG_LONG) rl.rlim_max);
  	}
  #endif
***************
*** 293,297 ****
  #if defined(HAVE_LONG_LONG)
  	if (sizeof(RLIM_INFINITY) > sizeof(long)) {
! 		v = PyLong_FromLongLong((LONG_LONG) RLIM_INFINITY);
  	} else 
  #endif
--- 293,297 ----
  #if defined(HAVE_LONG_LONG)
  	if (sizeof(RLIM_INFINITY) > sizeof(long)) {
! 		v = PyLong_FromLongLong((PY_LONG_LONG) RLIM_INFINITY);
  	} else 
  #endif

Index: socketmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v
retrieving revision 1.257
retrieving revision 1.258
diff -C2 -d -r1.257 -r1.258
*** socketmodule.c	19 Feb 2003 17:50:16 -0000	1.257
--- socketmodule.c	29 Mar 2003 10:04:54 -0000	1.258
***************
*** 1438,1442 ****
  	return PyInt_FromLong((long) s->sock_fd);
  #else
! 	return PyLong_FromLongLong((LONG_LONG)s->sock_fd);
  #endif
  }
--- 1438,1442 ----
  	return PyInt_FromLong((long) s->sock_fd);
  #else
! 	return PyLong_FromLongLong((PY_LONG_LONG)s->sock_fd);
  #endif
  }

Index: structmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/structmodule.c,v
retrieving revision 2.59
retrieving revision 2.60
diff -C2 -d -r2.59 -r2.60
*** structmodule.c	20 Mar 2003 20:53:31 -0000	2.59
--- structmodule.c	29 Mar 2003 10:04:55 -0000	2.60
***************
*** 69,74 ****
     in std mode, they're 8 bytes on all platforms. */
  #ifdef HAVE_LONG_LONG
! typedef struct { char c; LONG_LONG x; } s_long_long;
! #define LONG_LONG_ALIGN (sizeof(s_long_long) - sizeof(LONG_LONG))
  #endif
  
--- 69,74 ----
     in std mode, they're 8 bytes on all platforms. */
  #ifdef HAVE_LONG_LONG
! typedef struct { char c; PY_LONG_LONG x; } s_long_long;
! #define LONG_LONG_ALIGN (sizeof(s_long_long) - sizeof(PY_LONG_LONG))
  #endif
  
***************
*** 147,153 ****
  
  static int
! get_longlong(PyObject *v, LONG_LONG *p)
  {
! 	LONG_LONG x;
  
  	v = get_pylong(v);
--- 147,153 ----
  
  static int
! get_longlong(PyObject *v, PY_LONG_LONG *p)
  {
! 	PY_LONG_LONG x;
  
  	v = get_pylong(v);
***************
*** 157,161 ****
  	x = PyLong_AsLongLong(v);
  	Py_DECREF(v);
! 	if (x == (LONG_LONG)-1 && PyErr_Occurred())
  		return -1;
  	*p = x;
--- 157,161 ----
  	x = PyLong_AsLongLong(v);
  	Py_DECREF(v);
! 	if (x == (PY_LONG_LONG)-1 && PyErr_Occurred())
  		return -1;
  	*p = x;
***************
*** 166,172 ****
  
  static int
! get_ulonglong(PyObject *v, unsigned LONG_LONG *p)
  {
! 	unsigned LONG_LONG x;
  
  	v = get_pylong(v);
--- 166,172 ----
  
  static int
! get_ulonglong(PyObject *v, unsigned PY_LONG_LONG *p)
  {
! 	unsigned PY_LONG_LONG x;
  
  	v = get_pylong(v);
***************
*** 176,180 ****
  	x = PyLong_AsUnsignedLongLong(v);
  	Py_DECREF(v);
! 	if (x == (unsigned LONG_LONG)-1 && PyErr_Occurred())
  		return -1;
  	*p = x;
--- 176,180 ----
  	x = PyLong_AsUnsignedLongLong(v);
  	Py_DECREF(v);
! 	if (x == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())
  		return -1;
  	*p = x;
***************
*** 316,320 ****
  nu_longlong(const char *p, const formatdef *f)
  {
! 	LONG_LONG x;
  	memcpy((char *)&x, p, sizeof x);
  	return PyLong_FromLongLong(x);
--- 316,320 ----
  nu_longlong(const char *p, const formatdef *f)
  {
! 	PY_LONG_LONG x;
  	memcpy((char *)&x, p, sizeof x);
  	return PyLong_FromLongLong(x);
***************
*** 324,328 ****
  nu_ulonglong(const char *p, const formatdef *f)
  {
! 	unsigned LONG_LONG x;
  	memcpy((char *)&x, p, sizeof x);
  	return PyLong_FromUnsignedLongLong(x);
--- 324,328 ----
  nu_ulonglong(const char *p, const formatdef *f)
  {
! 	unsigned PY_LONG_LONG x;
  	memcpy((char *)&x, p, sizeof x);
  	return PyLong_FromUnsignedLongLong(x);
***************
*** 481,485 ****
  np_longlong(char *p, PyObject *v, const formatdef *f)
  {
! 	LONG_LONG x;
  	if (get_longlong(v, &x) < 0)
  		return -1;
--- 481,485 ----
  np_longlong(char *p, PyObject *v, const formatdef *f)
  {
! 	PY_LONG_LONG x;
  	if (get_longlong(v, &x) < 0)
  		return -1;
***************
*** 491,495 ****
  np_ulonglong(char *p, PyObject *v, const formatdef *f)
  {
! 	unsigned LONG_LONG x;
  	if (get_ulonglong(v, &x) < 0)
  		return -1;
--- 491,495 ----
  np_ulonglong(char *p, PyObject *v, const formatdef *f)
  {
! 	unsigned PY_LONG_LONG x;
  	if (get_ulonglong(v, &x) < 0)
  		return -1;
***************
*** 557,562 ****
  	{'P',	sizeof(void *),	VOID_P_ALIGN,	nu_void_p,	np_void_p},
  #ifdef HAVE_LONG_LONG
! 	{'q',	sizeof(LONG_LONG), LONG_LONG_ALIGN, nu_longlong, np_longlong},
! 	{'Q',	sizeof(LONG_LONG), LONG_LONG_ALIGN, nu_ulonglong,np_ulonglong},
  #endif
  	{0}
--- 557,562 ----
  	{'P',	sizeof(void *),	VOID_P_ALIGN,	nu_void_p,	np_void_p},
  #ifdef HAVE_LONG_LONG
! 	{'q',	sizeof(PY_LONG_LONG), LONG_LONG_ALIGN, nu_longlong, np_longlong},
! 	{'Q',	sizeof(PY_LONG_LONG), LONG_LONG_ALIGN, nu_ulonglong,np_ulonglong},
  #endif
  	{0}