[Python-checkins] bpo-27961: Replace PY_LONG_LONG with long long. (GH-15386)

Serhiy Storchaka webhook-mailer at python.org
Mon Oct 21 02:49:54 EDT 2019


https://github.com/python/cpython/commit/a9ed91e6c2f0f1a9960b1382321918448228a801
commit: a9ed91e6c2f0f1a9960b1382321918448228a801
branch: master
author: Sergey Fedoseev <fedoseev.sergey at gmail.com>
committer: Serhiy Storchaka <storchaka at gmail.com>
date: 2019-10-21T09:49:48+03:00
summary:

bpo-27961: Replace PY_LONG_LONG with long long. (GH-15386)

files:
M Lib/test/clinic.test
M Modules/_testcapimodule.c
M PC/pyconfig.h
M Tools/clinic/clinic.py

diff --git a/Lib/test/clinic.test b/Lib/test/clinic.test
index 0d84d5ef5359a..6ee9dc5a84b93 100644
--- a/Lib/test/clinic.test
+++ b/Lib/test/clinic.test
@@ -1269,7 +1269,7 @@ test_long_long_converter(PyObject *module, PyObject *const *args, Py_ssize_t nar
         goto exit;
     }
     a = PyLong_AsLongLong(args[0]);
-    if (a == (PY_LONG_LONG)-1 && PyErr_Occurred()) {
+    if (a == -1 && PyErr_Occurred()) {
         goto exit;
     }
 skip_optional:
@@ -1281,7 +1281,7 @@ exit:
 
 static PyObject *
 test_long_long_converter_impl(PyObject *module, long long a)
-/*[clinic end generated code: output=3e8083f3aee4f18a input=d5fc81577ff4dd02]*/
+/*[clinic end generated code: output=7143b585d7e433e8 input=d5fc81577ff4dd02]*/
 
 
 /*[clinic input]
diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index a18a8e7553ef2..baa6907b7e4f6 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -4763,8 +4763,8 @@ dict_get_version(PyObject *self, PyObject *args)
 
     version = dict->ma_version_tag;
 
-    Py_BUILD_ASSERT(sizeof(unsigned PY_LONG_LONG) >= sizeof(version));
-    return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)version);
+    Py_BUILD_ASSERT(sizeof(unsigned long long) >= sizeof(version));
+    return PyLong_FromUnsignedLongLong((unsigned long long)version);
 }
 
 
diff --git a/PC/pyconfig.h b/PC/pyconfig.h
index d407e1d4632af..6a437ce24bb3d 100644
--- a/PC/pyconfig.h
+++ b/PC/pyconfig.h
@@ -296,7 +296,7 @@ Py_NO_ENABLE_SHARED to find out.  Also support MS_NO_COREDLL for b/w compat */
 #       define SIZEOF_HKEY 8
 #       define SIZEOF_SIZE_T 8
 /* configure.ac defines HAVE_LARGEFILE_SUPPORT iff
-   sizeof(off_t) > sizeof(long), and sizeof(PY_LONG_LONG) >= sizeof(off_t).
+   sizeof(off_t) > sizeof(long), and sizeof(long long) >= sizeof(off_t).
    On Win64 the second condition is not true, but if fpos_t replaces off_t
    then this is true. The uses of HAVE_LARGEFILE_SUPPORT imply that Win64
    should define this. */
diff --git a/Tools/clinic/clinic.py b/Tools/clinic/clinic.py
index c5edc7c9336fb..403d8a4765690 100755
--- a/Tools/clinic/clinic.py
+++ b/Tools/clinic/clinic.py
@@ -3016,7 +3016,7 @@ def parse_arg(self, argname, displayname):
                     goto exit;
                 }}}}
                 {paramname} = PyLong_AsLongLong({argname});
-                if ({paramname} == (PY_LONG_LONG)-1 && PyErr_Occurred()) {{{{
+                if ({paramname} == -1 && PyErr_Occurred()) {{{{
                     goto exit;
                 }}}}
                 """.format(argname=argname, paramname=self.name)



More information about the Python-checkins mailing list