summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2003-03-29 10:06:18 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2003-03-29 10:06:18 (GMT)
commitb9a0f9121876cbc728cbef88f16bb32b92712d2d (patch)
tree2677795fd372f25549f84764a556bee87ec66f43 /Modules
parent043bbc7da387f613f3ce60c20063e2a29baff372 (diff)
downloadcpython-b9a0f9121876cbc728cbef88f16bb32b92712d2d.zip
cpython-b9a0f9121876cbc728cbef88f16bb32b92712d2d.tar.gz
cpython-b9a0f9121876cbc728cbef88f16bb32b92712d2d.tar.bz2
Rename LONG_LONG to PY_LONG_LONG. Fixes #710285.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_testcapimodule.c10
-rw-r--r--Modules/addrinfo.h4
-rw-r--r--Modules/bz2module.c8
-rw-r--r--Modules/posixmodule.c26
-rw-r--r--Modules/resource.c6
-rw-r--r--Modules/socketmodule.c2
-rw-r--r--Modules/structmodule.c28
7 files changed, 42 insertions, 42 deletions
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index 4c3c2aa..c08dbb7 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -56,7 +56,7 @@ test_config(PyObject *self)
CHECK_SIZEOF(SIZEOF_VOID_P, void*);
CHECK_SIZEOF(SIZEOF_TIME_T, time_t);
#ifdef HAVE_LONG_LONG
- CHECK_SIZEOF(SIZEOF_LONG_LONG, LONG_LONG);
+ CHECK_SIZEOF(SIZEOF_LONG_LONG, PY_LONG_LONG);
#endif
#undef CHECK_SIZEOF
@@ -172,7 +172,7 @@ test_dict_iteration(PyObject* self)
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
+ 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
would be perfect.
@@ -221,7 +221,7 @@ raise_test_longlong_error(const char* msg)
}
#define TESTNAME test_longlong_api_inner
-#define TYPENAME LONG_LONG
+#define TYPENAME PY_LONG_LONG
#define F_S_TO_PY PyLong_FromLongLong
#define F_PY_TO_S PyLong_AsLongLong
#define F_U_TO_PY PyLong_FromUnsignedLongLong
@@ -242,7 +242,7 @@ test_longlong_api(PyObject* self)
#undef F_U_TO_PY
#undef F_PY_TO_U
-/* Test the L code for PyArg_ParseTuple. This should deliver a LONG_LONG
+/* 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.
*/
@@ -250,7 +250,7 @@ static PyObject *
test_L_code(PyObject *self)
{
PyObject *tuple, *num;
- LONG_LONG value;
+ PY_LONG_LONG value;
tuple = PyTuple_New(1);
if (tuple == NULL)
diff --git a/Modules/addrinfo.h b/Modules/addrinfo.h
index 7f85d81..d781c0d 100644
--- a/Modules/addrinfo.h
+++ b/Modules/addrinfo.h
@@ -142,7 +142,7 @@ struct addrinfo {
*/
#define _SS_MAXSIZE 128
#ifdef HAVE_LONG_LONG
-#define _SS_ALIGNSIZE (sizeof(LONG_LONG))
+#define _SS_ALIGNSIZE (sizeof(PY_LONG_LONG))
#else
#define _SS_ALIGNSIZE (sizeof(double))
#endif
@@ -159,7 +159,7 @@ struct sockaddr_storage {
#endif
char __ss_pad1[_SS_PAD1SIZE];
#ifdef HAVE_LONG_LONG
- LONG_LONG __ss_align; /* force desired structure storage alignment */
+ PY_LONG_LONG __ss_align; /* force desired structure storage alignment */
#else
double __ss_align; /* force desired structure storage alignment */
#endif
diff --git a/Modules/bz2module.c b/Modules/bz2module.c
index 114070fa..5ab3f99 100644
--- a/Modules/bz2module.c
+++ b/Modules/bz2module.c
@@ -36,7 +36,7 @@ static char __author__[] =
(((long)bzs->total_out_hi32 << 32) + bzs->total_out_lo32)
#elif SIZEOF_LONG_LONG >= 8
#define BZS_TOTAL_OUT(bzs) \
- (((LONG_LONG)bzs->total_out_hi32 << 32) + bzs->total_out_lo32)
+ (((PY_LONG_LONG)bzs->total_out_hi32 << 32) + bzs->total_out_lo32)
#else
#define BZS_TOTAL_OUT(bzs) \
bzs->total_out_lo32;
@@ -1490,7 +1490,7 @@ BZ2Comp_compress(BZ2CompObject *self, PyObject *args)
char *data;
int datasize;
int bufsize = SMALLCHUNK;
- LONG_LONG totalout;
+ PY_LONG_LONG totalout;
PyObject *ret = NULL;
bz_stream *bzs = &self->bzs;
int bzerror;
@@ -1562,7 +1562,7 @@ BZ2Comp_flush(BZ2CompObject *self)
int bufsize = SMALLCHUNK;
PyObject *ret = NULL;
bz_stream *bzs = &self->bzs;
- LONG_LONG totalout;
+ PY_LONG_LONG totalout;
int bzerror;
ACQUIRE_LOCK(self);
@@ -1768,7 +1768,7 @@ BZ2Decomp_decompress(BZ2DecompObject *self, PyObject *args)
char *data;
int datasize;
int bufsize = SMALLCHUNK;
- LONG_LONG totalout;
+ PY_LONG_LONG totalout;
PyObject *ret = NULL;
bz_stream *bzs = &self->bzs;
int bzerror;
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index ab4992e..9bf52f3 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -891,7 +891,7 @@ fill_time(PyObject *v, int index, time_t sec, unsigned long nsec)
{
PyObject *fval,*ival;
#if SIZEOF_TIME_T > SIZEOF_LONG
- ival = PyLong_FromLongLong((LONG_LONG)sec);
+ ival = PyLong_FromLongLong((PY_LONG_LONG)sec);
#else
ival = PyInt_FromLong((long)sec);
#endif
@@ -918,13 +918,13 @@ _pystat_fromstructstat(STRUCT_STAT st)
PyStructSequence_SET_ITEM(v, 0, PyInt_FromLong((long)st.st_mode));
#ifdef HAVE_LARGEFILE_SUPPORT
PyStructSequence_SET_ITEM(v, 1,
- PyLong_FromLongLong((LONG_LONG)st.st_ino));
+ PyLong_FromLongLong((PY_LONG_LONG)st.st_ino));
#else
PyStructSequence_SET_ITEM(v, 1, PyInt_FromLong((long)st.st_ino));
#endif
#if defined(HAVE_LONG_LONG) && !defined(MS_WINDOWS)
PyStructSequence_SET_ITEM(v, 2,
- PyLong_FromLongLong((LONG_LONG)st.st_dev));
+ PyLong_FromLongLong((PY_LONG_LONG)st.st_dev));
#else
PyStructSequence_SET_ITEM(v, 2, PyInt_FromLong((long)st.st_dev));
#endif
@@ -933,7 +933,7 @@ _pystat_fromstructstat(STRUCT_STAT st)
PyStructSequence_SET_ITEM(v, 5, PyInt_FromLong((long)st.st_gid));
#ifdef HAVE_LARGEFILE_SUPPORT
PyStructSequence_SET_ITEM(v, 6,
- PyLong_FromLongLong((LONG_LONG)st.st_size));
+ PyLong_FromLongLong((PY_LONG_LONG)st.st_size));
#else
PyStructSequence_SET_ITEM(v, 6, PyInt_FromLong(st.st_size));
#endif
@@ -2376,7 +2376,7 @@ posix_spawnv(PyObject *self, PyObject *args)
#if SIZEOF_LONG == SIZEOF_VOID_P
return Py_BuildValue("l", (long) spawnval);
#else
- return Py_BuildValue("L", (LONG_LONG) spawnval);
+ return Py_BuildValue("L", (PY_LONG_LONG) spawnval);
#endif
}
@@ -2517,7 +2517,7 @@ posix_spawnve(PyObject *self, PyObject *args)
#if SIZEOF_LONG == SIZEOF_VOID_P
res = Py_BuildValue("l", (long) spawnval);
#else
- res = Py_BuildValue("L", (LONG_LONG) spawnval);
+ res = Py_BuildValue("L", (PY_LONG_LONG) spawnval);
#endif
fail_2:
@@ -5084,7 +5084,7 @@ posix_lseek(PyObject *self, PyObject *args)
{
int fd, how;
#if defined(MS_WIN64) || defined(MS_WINDOWS)
- LONG_LONG pos, res;
+ PY_LONG_LONG pos, res;
#else
off_t pos, res;
#endif
@@ -5816,17 +5816,17 @@ _pystatvfs_fromstructstatvfs(struct statvfs st) {
PyStructSequence_SET_ITEM(v, 0, PyInt_FromLong((long) st.f_bsize));
PyStructSequence_SET_ITEM(v, 1, PyInt_FromLong((long) st.f_frsize));
PyStructSequence_SET_ITEM(v, 2,
- PyLong_FromLongLong((LONG_LONG) st.f_blocks));
+ PyLong_FromLongLong((PY_LONG_LONG) st.f_blocks));
PyStructSequence_SET_ITEM(v, 3,
- PyLong_FromLongLong((LONG_LONG) st.f_bfree));
+ PyLong_FromLongLong((PY_LONG_LONG) st.f_bfree));
PyStructSequence_SET_ITEM(v, 4,
- PyLong_FromLongLong((LONG_LONG) st.f_bavail));
+ PyLong_FromLongLong((PY_LONG_LONG) st.f_bavail));
PyStructSequence_SET_ITEM(v, 5,
- PyLong_FromLongLong((LONG_LONG) st.f_files));
+ PyLong_FromLongLong((PY_LONG_LONG) st.f_files));
PyStructSequence_SET_ITEM(v, 6,
- PyLong_FromLongLong((LONG_LONG) st.f_ffree));
+ PyLong_FromLongLong((PY_LONG_LONG) st.f_ffree));
PyStructSequence_SET_ITEM(v, 7,
- PyLong_FromLongLong((LONG_LONG) st.f_favail));
+ 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));
#endif
diff --git a/Modules/resource.c b/Modules/resource.c
index 8653f03..003599d 100644
--- a/Modules/resource.c
+++ b/Modules/resource.c
@@ -128,8 +128,8 @@ resource_getrlimit(PyObject *self, PyObject *args)
#if defined(HAVE_LONG_LONG)
if (sizeof(rl.rlim_cur) > sizeof(long)) {
return Py_BuildValue("LL",
- (LONG_LONG) rl.rlim_cur,
- (LONG_LONG) rl.rlim_max);
+ (PY_LONG_LONG) rl.rlim_cur,
+ (PY_LONG_LONG) rl.rlim_max);
}
#endif
return Py_BuildValue("ll", (long) rl.rlim_cur, (long) rl.rlim_max);
@@ -292,7 +292,7 @@ initresource(void)
#if defined(HAVE_LONG_LONG)
if (sizeof(RLIM_INFINITY) > sizeof(long)) {
- v = PyLong_FromLongLong((LONG_LONG) RLIM_INFINITY);
+ v = PyLong_FromLongLong((PY_LONG_LONG) RLIM_INFINITY);
} else
#endif
{
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 2b8e3ea..9d8d614 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -1437,7 +1437,7 @@ sock_fileno(PySocketSockObject *s)
#if SIZEOF_SOCKET_T <= SIZEOF_LONG
return PyInt_FromLong((long) s->sock_fd);
#else
- return PyLong_FromLongLong((LONG_LONG)s->sock_fd);
+ return PyLong_FromLongLong((PY_LONG_LONG)s->sock_fd);
#endif
}
diff --git a/Modules/structmodule.c b/Modules/structmodule.c
index e4e1eb5..22f1c54 100644
--- a/Modules/structmodule.c
+++ b/Modules/structmodule.c
@@ -68,8 +68,8 @@ typedef struct { char c; void *x; } st_void_p;
/* We can't support q and Q in native mode unless the compiler does;
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))
+typedef struct { char c; PY_LONG_LONG x; } s_long_long;
+#define LONG_LONG_ALIGN (sizeof(s_long_long) - sizeof(PY_LONG_LONG))
#endif
#define STRINGIFY(x) #x
@@ -146,9 +146,9 @@ get_ulong(PyObject *v, unsigned long *p)
/* Same, but handling native long long. */
static int
-get_longlong(PyObject *v, LONG_LONG *p)
+get_longlong(PyObject *v, PY_LONG_LONG *p)
{
- LONG_LONG x;
+ PY_LONG_LONG x;
v = get_pylong(v);
if (v == NULL)
@@ -156,7 +156,7 @@ get_longlong(PyObject *v, LONG_LONG *p)
assert(PyLong_Check(v));
x = PyLong_AsLongLong(v);
Py_DECREF(v);
- if (x == (LONG_LONG)-1 && PyErr_Occurred())
+ if (x == (PY_LONG_LONG)-1 && PyErr_Occurred())
return -1;
*p = x;
return 0;
@@ -165,9 +165,9 @@ get_longlong(PyObject *v, LONG_LONG *p)
/* Same, but handling native unsigned long long. */
static int
-get_ulonglong(PyObject *v, unsigned LONG_LONG *p)
+get_ulonglong(PyObject *v, unsigned PY_LONG_LONG *p)
{
- unsigned LONG_LONG x;
+ unsigned PY_LONG_LONG x;
v = get_pylong(v);
if (v == NULL)
@@ -175,7 +175,7 @@ get_ulonglong(PyObject *v, unsigned LONG_LONG *p)
assert(PyLong_Check(v));
x = PyLong_AsUnsignedLongLong(v);
Py_DECREF(v);
- if (x == (unsigned LONG_LONG)-1 && PyErr_Occurred())
+ if (x == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())
return -1;
*p = x;
return 0;
@@ -315,7 +315,7 @@ nu_ulong(const char *p, const formatdef *f)
static PyObject *
nu_longlong(const char *p, const formatdef *f)
{
- LONG_LONG x;
+ PY_LONG_LONG x;
memcpy((char *)&x, p, sizeof x);
return PyLong_FromLongLong(x);
}
@@ -323,7 +323,7 @@ nu_longlong(const char *p, const formatdef *f)
static PyObject *
nu_ulonglong(const char *p, const formatdef *f)
{
- unsigned LONG_LONG x;
+ unsigned PY_LONG_LONG x;
memcpy((char *)&x, p, sizeof x);
return PyLong_FromUnsignedLongLong(x);
}
@@ -480,7 +480,7 @@ np_ulong(char *p, PyObject *v, const formatdef *f)
static int
np_longlong(char *p, PyObject *v, const formatdef *f)
{
- LONG_LONG x;
+ PY_LONG_LONG x;
if (get_longlong(v, &x) < 0)
return -1;
memcpy(p, (char *)&x, sizeof x);
@@ -490,7 +490,7 @@ np_longlong(char *p, PyObject *v, const formatdef *f)
static int
np_ulonglong(char *p, PyObject *v, const formatdef *f)
{
- unsigned LONG_LONG x;
+ unsigned PY_LONG_LONG x;
if (get_ulonglong(v, &x) < 0)
return -1;
memcpy(p, (char *)&x, sizeof x);
@@ -556,8 +556,8 @@ static formatdef native_table[] = {
{'d', sizeof(double), DOUBLE_ALIGN, nu_double, np_double},
{'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},
+ {'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}
};