summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2016-09-08 16:15:54 (GMT)
committerBenjamin Peterson <benjamin@python.org>2016-09-08 16:15:54 (GMT)
commit47ff0734b817d293ae84603efad2f3f508d85f78 (patch)
tree4be3f7fa6164e1a3ca0e3a1b9fdd3a7b12f334c3 /Modules
parentc71ec8aef37f8a72d1dc3237b127f15a32ba0997 (diff)
downloadcpython-47ff0734b817d293ae84603efad2f3f508d85f78.zip
cpython-47ff0734b817d293ae84603efad2f3f508d85f78.tar.gz
cpython-47ff0734b817d293ae84603efad2f3f508d85f78.tar.bz2
more PY_LONG_LONG to long long
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_blake2/blake2b_impl.c4
-rw-r--r--Modules/_blake2/blake2s_impl.c4
-rw-r--r--Modules/_ctypes/_ctypes_test.c40
-rw-r--r--Modules/_ctypes/callproc.c2
-rw-r--r--Modules/_ctypes/cfield.c48
-rw-r--r--Modules/_ctypes/ctypes.h2
-rw-r--r--Modules/_io/_iomodule.h14
-rw-r--r--Modules/_io/textio.c4
-rw-r--r--Modules/_sqlite/util.c2
9 files changed, 60 insertions, 60 deletions
diff --git a/Modules/_blake2/blake2b_impl.c b/Modules/_blake2/blake2b_impl.c
index 9c3d8f5..58b502b 100644
--- a/Modules/_blake2/blake2b_impl.c
+++ b/Modules/_blake2/blake2b_impl.c
@@ -100,7 +100,7 @@ py_blake2b_new_impl(PyTypeObject *type, PyObject *data, int digest_size,
Py_buffer buf;
unsigned long leaf_size = 0;
- unsigned PY_LONG_LONG node_offset = 0;
+ unsigned long long node_offset = 0;
self = new_BLAKE2bObject(type);
if (self == NULL) {
@@ -170,7 +170,7 @@ py_blake2b_new_impl(PyTypeObject *type, PyObject *data, int digest_size,
if (node_offset_obj != NULL) {
node_offset = PyLong_AsUnsignedLongLong(node_offset_obj);
- if (node_offset == (unsigned PY_LONG_LONG) -1 && PyErr_Occurred()) {
+ if (node_offset == (unsigned long long) -1 && PyErr_Occurred()) {
goto error;
}
}
diff --git a/Modules/_blake2/blake2s_impl.c b/Modules/_blake2/blake2s_impl.c
index 53c22c2..11d2e02 100644
--- a/Modules/_blake2/blake2s_impl.c
+++ b/Modules/_blake2/blake2s_impl.c
@@ -100,7 +100,7 @@ py_blake2s_new_impl(PyTypeObject *type, PyObject *data, int digest_size,
Py_buffer buf;
unsigned long leaf_size = 0;
- unsigned PY_LONG_LONG node_offset = 0;
+ unsigned long long node_offset = 0;
self = new_BLAKE2sObject(type);
if (self == NULL) {
@@ -170,7 +170,7 @@ py_blake2s_new_impl(PyTypeObject *type, PyObject *data, int digest_size,
if (node_offset_obj != NULL) {
node_offset = PyLong_AsUnsignedLongLong(node_offset_obj);
- if (node_offset == (unsigned PY_LONG_LONG) -1 && PyErr_Occurred()) {
+ if (node_offset == (unsigned long long) -1 && PyErr_Occurred()) {
goto error;
}
}
diff --git a/Modules/_ctypes/_ctypes_test.c b/Modules/_ctypes/_ctypes_test.c
index 92c3b9e..629ddf6 100644
--- a/Modules/_ctypes/_ctypes_test.c
+++ b/Modules/_ctypes/_ctypes_test.c
@@ -233,15 +233,15 @@ EXPORT(int) _testfunc_callback_with_pointer(int (*func)(int *))
return (*func)(table);
}
-EXPORT(PY_LONG_LONG) _testfunc_q_bhilfdq(signed char b, short h, int i, long l, float f,
- double d, PY_LONG_LONG q)
+EXPORT(long long) _testfunc_q_bhilfdq(signed char b, short h, int i, long l, float f,
+ double d, long long q)
{
- return (PY_LONG_LONG)(b + h + i + l + f + d + q);
+ return (long long)(b + h + i + l + f + d + q);
}
-EXPORT(PY_LONG_LONG) _testfunc_q_bhilfd(signed char b, short h, int i, long l, float f, double d)
+EXPORT(long long) _testfunc_q_bhilfd(signed char b, short h, int i, long l, float f, double d)
{
- return (PY_LONG_LONG)(b + h + i + l + f + d);
+ return (long long)(b + h + i + l + f + d);
}
EXPORT(int) _testfunc_callback_i_if(int value, int (*func)(int))
@@ -254,10 +254,10 @@ EXPORT(int) _testfunc_callback_i_if(int value, int (*func)(int))
return sum;
}
-EXPORT(PY_LONG_LONG) _testfunc_callback_q_qf(PY_LONG_LONG value,
- PY_LONG_LONG (*func)(PY_LONG_LONG))
+EXPORT(long long) _testfunc_callback_q_qf(long long value,
+ long long (*func)(long long))
{
- PY_LONG_LONG sum = 0;
+ long long sum = 0;
while (value != 0) {
sum += func(value);
@@ -381,8 +381,8 @@ EXPORT(void) _py_func(void)
{
}
-EXPORT(PY_LONG_LONG) last_tf_arg_s;
-EXPORT(unsigned PY_LONG_LONG) last_tf_arg_u;
+EXPORT(long long) last_tf_arg_s;
+EXPORT(unsigned long long) last_tf_arg_u;
struct BITS {
int A: 1, B:2, C:3, D:4, E: 5, F: 6, G: 7, H: 8, I: 9;
@@ -445,8 +445,8 @@ static PyMethodDef module_methods[] = {
{ NULL, NULL, 0, NULL},
};
-#define S last_tf_arg_s = (PY_LONG_LONG)c
-#define U last_tf_arg_u = (unsigned PY_LONG_LONG)c
+#define S last_tf_arg_s = (long long)c
+#define U last_tf_arg_u = (unsigned long long)c
EXPORT(signed char) tf_b(signed char c) { S; return c/3; }
EXPORT(unsigned char) tf_B(unsigned char c) { U; return c/3; }
@@ -456,8 +456,8 @@ EXPORT(int) tf_i(int c) { S; return c/3; }
EXPORT(unsigned int) tf_I(unsigned int c) { U; return c/3; }
EXPORT(long) tf_l(long c) { S; return c/3; }
EXPORT(unsigned long) tf_L(unsigned long c) { U; return c/3; }
-EXPORT(PY_LONG_LONG) tf_q(PY_LONG_LONG c) { S; return c/3; }
-EXPORT(unsigned PY_LONG_LONG) tf_Q(unsigned PY_LONG_LONG c) { U; return c/3; }
+EXPORT(long long) tf_q(long long c) { S; return c/3; }
+EXPORT(unsigned long long) tf_Q(unsigned long long c) { U; return c/3; }
EXPORT(float) tf_f(float c) { S; return c/3; }
EXPORT(double) tf_d(double c) { S; return c/3; }
EXPORT(long double) tf_D(long double c) { S; return c/3; }
@@ -471,8 +471,8 @@ EXPORT(int) __stdcall s_tf_i(int c) { S; return c/3; }
EXPORT(unsigned int) __stdcall s_tf_I(unsigned int c) { U; return c/3; }
EXPORT(long) __stdcall s_tf_l(long c) { S; return c/3; }
EXPORT(unsigned long) __stdcall s_tf_L(unsigned long c) { U; return c/3; }
-EXPORT(PY_LONG_LONG) __stdcall s_tf_q(PY_LONG_LONG c) { S; return c/3; }
-EXPORT(unsigned PY_LONG_LONG) __stdcall s_tf_Q(unsigned PY_LONG_LONG c) { U; return c/3; }
+EXPORT(long long) __stdcall s_tf_q(long long c) { S; return c/3; }
+EXPORT(unsigned long long) __stdcall s_tf_Q(unsigned long long c) { U; return c/3; }
EXPORT(float) __stdcall s_tf_f(float c) { S; return c/3; }
EXPORT(double) __stdcall s_tf_d(double c) { S; return c/3; }
EXPORT(long double) __stdcall s_tf_D(long double c) { S; return c/3; }
@@ -487,8 +487,8 @@ EXPORT(int) tf_bi(signed char x, int c) { S; return c/3; }
EXPORT(unsigned int) tf_bI(signed char x, unsigned int c) { U; return c/3; }
EXPORT(long) tf_bl(signed char x, long c) { S; return c/3; }
EXPORT(unsigned long) tf_bL(signed char x, unsigned long c) { U; return c/3; }
-EXPORT(PY_LONG_LONG) tf_bq(signed char x, PY_LONG_LONG c) { S; return c/3; }
-EXPORT(unsigned PY_LONG_LONG) tf_bQ(signed char x, unsigned PY_LONG_LONG c) { U; return c/3; }
+EXPORT(long long) tf_bq(signed char x, long long c) { S; return c/3; }
+EXPORT(unsigned long long) tf_bQ(signed char x, unsigned long long c) { U; return c/3; }
EXPORT(float) tf_bf(signed char x, float c) { S; return c/3; }
EXPORT(double) tf_bd(signed char x, double c) { S; return c/3; }
EXPORT(long double) tf_bD(signed char x, long double c) { S; return c/3; }
@@ -503,8 +503,8 @@ EXPORT(int) __stdcall s_tf_bi(signed char x, int c) { S; return c/3; }
EXPORT(unsigned int) __stdcall s_tf_bI(signed char x, unsigned int c) { U; return c/3; }
EXPORT(long) __stdcall s_tf_bl(signed char x, long c) { S; return c/3; }
EXPORT(unsigned long) __stdcall s_tf_bL(signed char x, unsigned long c) { U; return c/3; }
-EXPORT(PY_LONG_LONG) __stdcall s_tf_bq(signed char x, PY_LONG_LONG c) { S; return c/3; }
-EXPORT(unsigned PY_LONG_LONG) __stdcall s_tf_bQ(signed char x, unsigned PY_LONG_LONG c) { U; return c/3; }
+EXPORT(long long) __stdcall s_tf_bq(signed char x, long long c) { S; return c/3; }
+EXPORT(unsigned long long) __stdcall s_tf_bQ(signed char x, unsigned long long c) { U; return c/3; }
EXPORT(float) __stdcall s_tf_bf(signed char x, float c) { S; return c/3; }
EXPORT(double) __stdcall s_tf_bd(signed char x, double c) { S; return c/3; }
EXPORT(long double) __stdcall s_tf_bD(signed char x, long double c) { S; return c/3; }
diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c
index 5fc96f7..d3044f3 100644
--- a/Modules/_ctypes/callproc.c
+++ b/Modules/_ctypes/callproc.c
@@ -591,7 +591,7 @@ union result {
short h;
int i;
long l;
- PY_LONG_LONG q;
+ long long q;
long double D;
double d;
float f;
diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c
index 782336d..a43585f 100644
--- a/Modules/_ctypes/cfield.c
+++ b/Modules/_ctypes/cfield.c
@@ -382,9 +382,9 @@ get_ulong(PyObject *v, unsigned long *p)
/* Same, but handling native long long. */
static int
-get_longlong(PyObject *v, PY_LONG_LONG *p)
+get_longlong(PyObject *v, long long *p)
{
- PY_LONG_LONG x;
+ long long x;
if (PyFloat_Check(v)) {
PyErr_SetString(PyExc_TypeError,
"int expected instead of float");
@@ -400,16 +400,16 @@ get_longlong(PyObject *v, PY_LONG_LONG *p)
/* Same, but handling native unsigned long long. */
static int
-get_ulonglong(PyObject *v, unsigned PY_LONG_LONG *p)
+get_ulonglong(PyObject *v, unsigned long long *p)
{
- unsigned PY_LONG_LONG x;
+ unsigned long long x;
if (PyFloat_Check(v)) {
PyErr_SetString(PyExc_TypeError,
"int expected instead of float");
return -1;
}
x = PyLong_AsUnsignedLongLongMask(v);
- if (x == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())
+ if (x == (unsigned long long)-1 && PyErr_Occurred())
return -1;
*p = x;
return 0;
@@ -879,12 +879,12 @@ L_get_sw(void *ptr, Py_ssize_t size)
static PyObject *
q_set(void *ptr, PyObject *value, Py_ssize_t size)
{
- PY_LONG_LONG val;
- PY_LONG_LONG x;
+ long long val;
+ long long x;
if (get_longlong(value, &val) < 0)
return NULL;
memcpy(&x, ptr, sizeof(x));
- x = SET(PY_LONG_LONG, x, val, size);
+ x = SET(long long, x, val, size);
memcpy(ptr, &x, sizeof(x));
_RET(value);
}
@@ -892,13 +892,13 @@ q_set(void *ptr, PyObject *value, Py_ssize_t size)
static PyObject *
q_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
{
- PY_LONG_LONG val;
- PY_LONG_LONG field;
+ long long val;
+ long long field;
if (get_longlong(value, &val) < 0)
return NULL;
memcpy(&field, ptr, sizeof(field));
field = SWAP_8(field);
- field = SET(PY_LONG_LONG, field, val, size);
+ field = SET(long long, field, val, size);
field = SWAP_8(field);
memcpy(ptr, &field, sizeof(field));
_RET(value);
@@ -907,7 +907,7 @@ q_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
static PyObject *
q_get(void *ptr, Py_ssize_t size)
{
- PY_LONG_LONG val;
+ long long val;
memcpy(&val, ptr, sizeof(val));
GET_BITFIELD(val, size);
return PyLong_FromLongLong(val);
@@ -916,7 +916,7 @@ q_get(void *ptr, Py_ssize_t size)
static PyObject *
q_get_sw(void *ptr, Py_ssize_t size)
{
- PY_LONG_LONG val;
+ long long val;
memcpy(&val, ptr, sizeof(val));
val = SWAP_8(val);
GET_BITFIELD(val, size);
@@ -926,12 +926,12 @@ q_get_sw(void *ptr, Py_ssize_t size)
static PyObject *
Q_set(void *ptr, PyObject *value, Py_ssize_t size)
{
- unsigned PY_LONG_LONG val;
- unsigned PY_LONG_LONG x;
+ unsigned long long val;
+ unsigned long long x;
if (get_ulonglong(value, &val) < 0)
return NULL;
memcpy(&x, ptr, sizeof(x));
- x = SET(PY_LONG_LONG, x, val, size);
+ x = SET(long long, x, val, size);
memcpy(ptr, &x, sizeof(x));
_RET(value);
}
@@ -939,13 +939,13 @@ Q_set(void *ptr, PyObject *value, Py_ssize_t size)
static PyObject *
Q_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
{
- unsigned PY_LONG_LONG val;
- unsigned PY_LONG_LONG field;
+ unsigned long long val;
+ unsigned long long field;
if (get_ulonglong(value, &val) < 0)
return NULL;
memcpy(&field, ptr, sizeof(field));
field = SWAP_8(field);
- field = SET(unsigned PY_LONG_LONG, field, val, size);
+ field = SET(unsigned long long, field, val, size);
field = SWAP_8(field);
memcpy(ptr, &field, sizeof(field));
_RET(value);
@@ -954,7 +954,7 @@ Q_set_sw(void *ptr, PyObject *value, Py_ssize_t size)
static PyObject *
Q_get(void *ptr, Py_ssize_t size)
{
- unsigned PY_LONG_LONG val;
+ unsigned long long val;
memcpy(&val, ptr, sizeof(val));
GET_BITFIELD(val, size);
return PyLong_FromUnsignedLongLong(val);
@@ -963,7 +963,7 @@ Q_get(void *ptr, Py_ssize_t size)
static PyObject *
Q_get_sw(void *ptr, Py_ssize_t size)
{
- unsigned PY_LONG_LONG val;
+ unsigned long long val;
memcpy(&val, ptr, sizeof(val));
val = SWAP_8(val);
GET_BITFIELD(val, size);
@@ -1477,7 +1477,7 @@ P_set(void *ptr, PyObject *value, Py_ssize_t size)
v = (void *)PyLong_AsUnsignedLongMask(value);
#else
#if SIZEOF_LONG_LONG < SIZEOF_VOID_P
-# error "PyLong_AsVoidPtr: sizeof(PY_LONG_LONG) < sizeof(void*)"
+# error "PyLong_AsVoidPtr: sizeof(long long) < sizeof(void*)"
#endif
v = (void *)PyLong_AsUnsignedLongLongMask(value);
#endif
@@ -1617,8 +1617,8 @@ typedef struct { char c; wchar_t *x; } s_wchar_p;
#endif
*/
-typedef struct { char c; PY_LONG_LONG x; } s_long_long;
-#define LONG_LONG_ALIGN (sizeof(s_long_long) - sizeof(PY_LONG_LONG))
+typedef struct { char c; long long x; } s_long_long;
+#define LONG_LONG_ALIGN (sizeof(s_long_long) - sizeof(long long))
/* from ffi.h:
typedef struct _ffi_type
diff --git a/Modules/_ctypes/ctypes.h b/Modules/_ctypes/ctypes.h
index 64cb69f..b71f139 100644
--- a/Modules/_ctypes/ctypes.h
+++ b/Modules/_ctypes/ctypes.h
@@ -301,7 +301,7 @@ struct tagPyCArgObject {
short h;
int i;
long l;
- PY_LONG_LONG q;
+ long long q;
long double D;
double d;
float f;
diff --git a/Modules/_io/_iomodule.h b/Modules/_io/_iomodule.h
index 007e0c4..8b5ec88 100644
--- a/Modules/_io/_iomodule.h
+++ b/Modules/_io/_iomodule.h
@@ -85,12 +85,12 @@ extern int _PyIO_trap_eintr(void);
#ifdef MS_WINDOWS
/* Windows uses long long for offsets */
-typedef PY_LONG_LONG Py_off_t;
+typedef long long Py_off_t;
# define PyLong_AsOff_t PyLong_AsLongLong
# define PyLong_FromOff_t PyLong_FromLongLong
-# define PY_OFF_T_MAX PY_LLONG_MAX
-# define PY_OFF_T_MIN PY_LLONG_MIN
-# define PY_OFF_T_COMPAT PY_LONG_LONG /* type compatible with off_t */
+# define PY_OFF_T_MAX LLONG_MAX
+# define PY_OFF_T_MIN LLONG_MIN
+# define PY_OFF_T_COMPAT long long /* type compatible with off_t */
# define PY_PRIdOFF "lld" /* format to use for that type */
#else
@@ -107,9 +107,9 @@ typedef off_t Py_off_t;
#elif (SIZEOF_OFF_T == SIZEOF_LONG_LONG)
# define PyLong_AsOff_t PyLong_AsLongLong
# define PyLong_FromOff_t PyLong_FromLongLong
-# define PY_OFF_T_MAX PY_LLONG_MAX
-# define PY_OFF_T_MIN PY_LLONG_MIN
-# define PY_OFF_T_COMPAT PY_LONG_LONG
+# define PY_OFF_T_MAX LLONG_MAX
+# define PY_OFF_T_MIN LLONG_MIN
+# define PY_OFF_T_COMPAT long long
# define PY_PRIdOFF "lld"
#elif (SIZEOF_OFF_T == SIZEOF_LONG)
# define PyLong_AsOff_t PyLong_AsLong
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c
index 96c8e7b..508e46e 100644
--- a/Modules/_io/textio.c
+++ b/Modules/_io/textio.c
@@ -531,7 +531,7 @@ _io_IncrementalNewlineDecoder_getstate_impl(nldecoder_object *self)
/*[clinic end generated code: output=f0d2c9c136f4e0d0 input=f8ff101825e32e7f]*/
{
PyObject *buffer;
- unsigned PY_LONG_LONG flag;
+ unsigned long long flag;
if (self->decoder != Py_None) {
PyObject *state = PyObject_CallMethodObjArgs(self->decoder,
@@ -567,7 +567,7 @@ _io_IncrementalNewlineDecoder_setstate(nldecoder_object *self,
/*[clinic end generated code: output=c10c622508b576cb input=c53fb505a76dbbe2]*/
{
PyObject *buffer;
- unsigned PY_LONG_LONG flag;
+ unsigned long long flag;
if (!PyArg_ParseTuple(state, "OK", &buffer, &flag))
return NULL;
diff --git a/Modules/_sqlite/util.c b/Modules/_sqlite/util.c
index a276dad..351b1b4 100644
--- a/Modules/_sqlite/util.c
+++ b/Modules/_sqlite/util.c
@@ -130,7 +130,7 @@ sqlite_int64
_pysqlite_long_as_int64(PyObject * py_val)
{
int overflow;
- PY_LONG_LONG value = PyLong_AsLongLongAndOverflow(py_val, &overflow);
+ long long value = PyLong_AsLongLongAndOverflow(py_val, &overflow);
if (value == -1 && PyErr_Occurred())
return -1;
if (!overflow) {