summaryrefslogtreecommitdiff
path: root/Modules/_lzmamodule.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2016-09-06 10:46:49 -0700
committerBenjamin Peterson <benjamin@python.org>2016-09-06 10:46:49 -0700
commit914b59533a094e815809f62441d02b560e23057b (patch)
tree387c68b0cde030cf6ff0a63d42881de64bb56c9b /Modules/_lzmamodule.c
parentd10c4e6a0bbcea8170f87cf1c0a3c823421e9178 (diff)
downloadcpython-914b59533a094e815809f62441d02b560e23057b.tar.gz
replace PY_LONG_LONG with long long
Diffstat (limited to 'Modules/_lzmamodule.c')
-rw-r--r--Modules/_lzmamodule.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/Modules/_lzmamodule.c b/Modules/_lzmamodule.c
index ce4e17fc86..5e158fd07d 100644
--- a/Modules/_lzmamodule.c
+++ b/Modules/_lzmamodule.c
@@ -18,12 +18,6 @@
#include <lzma.h>
-
-#ifndef PY_LONG_LONG
-#error "This module requires PY_LONG_LONG to be defined"
-#endif
-
-
#ifdef WITH_THREAD
#define ACQUIRE_LOCK(obj) do { \
if (!PyThread_acquire_lock((obj)->lock, 0)) { \
@@ -163,7 +157,7 @@ grow_buffer(PyObject **buf, Py_ssize_t max_length)
uint32_t - the "I" (unsigned int) specifier is the right size, but
silently ignores overflows on conversion.
- lzma_vli - the "K" (unsigned PY_LONG_LONG) specifier is the right
+ lzma_vli - the "K" (unsigned long long) specifier is the right
size, but like "I" it silently ignores overflows on conversion.
lzma_mode and lzma_match_finder - these are enumeration types, and
@@ -176,12 +170,12 @@ grow_buffer(PyObject **buf, Py_ssize_t max_length)
static int \
FUNCNAME(PyObject *obj, void *ptr) \
{ \
- unsigned PY_LONG_LONG val; \
+ unsigned long long val; \
\
val = PyLong_AsUnsignedLongLong(obj); \
if (PyErr_Occurred()) \
return 0; \
- if ((unsigned PY_LONG_LONG)(TYPE)val != val) { \
+ if ((unsigned long long)(TYPE)val != val) { \
PyErr_SetString(PyExc_OverflowError, \
"Value too large for " #TYPE " type"); \
return 0; \
@@ -398,7 +392,7 @@ parse_filter_chain_spec(lzma_filter filters[], PyObject *filterspecs)
Python-level filter specifiers (represented as dicts). */
static int
-spec_add_field(PyObject *spec, _Py_Identifier *key, unsigned PY_LONG_LONG value)
+spec_add_field(PyObject *spec, _Py_Identifier *key, unsigned long long value)
{
int status;
PyObject *value_object;
@@ -1441,7 +1435,7 @@ static PyModuleDef _lzmamodule = {
/* Some of our constants are more than 32 bits wide, so PyModule_AddIntConstant
would not work correctly on platforms with 32-bit longs. */
static int
-module_add_int_constant(PyObject *m, const char *name, PY_LONG_LONG value)
+module_add_int_constant(PyObject *m, const char *name, long long value)
{
PyObject *o = PyLong_FromLongLong(value);
if (o == NULL)