Skip to content

Commit 802add3

Browse files
jcfrmrbean-bremen
authored andcommitted
chore(PythonQt): replace PyInt_AS_LONG with PyLong_AS_LONG
No functional change intended.
1 parent c04abec commit 802add3

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

src/PythonQtConversion.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ void* PythonQtConv::ConvertPythonToQt(const PythonQtMethodInfo::ParameterInfo& i
638638
ok = false;
639639
if ((PyObject*)obj->ob_type == info.enumWrapper) {
640640
// we have a exact enum type match:
641-
val = PyInt_AS_LONG(obj);
641+
val = PyLong_AS_LONG(obj);
642642
ok = true;
643643
}
644644
else if (!strict) {
@@ -887,11 +887,11 @@ int PythonQtConv::PyObjGetInt(PyObject* val, bool strict, bool &ok) {
887887
int d = 0;
888888
ok = true;
889889
if (val->ob_type == &PyLong_Type) {
890-
d = PyInt_AS_LONG(val);
890+
d = PyLong_AS_LONG(val);
891891
} else if (!strict) {
892892
if (PyObject_TypeCheck(val, &PyLong_Type)) {
893893
// support for derived int classes, e.g. for our enums
894-
d = PyInt_AS_LONG(val);
894+
d = PyLong_AS_LONG(val);
895895
} else if (val->ob_type == &PyFloat_Type) {
896896
d = floor(PyFloat_AS_DOUBLE(val));
897897
} else if (val->ob_type == &PyLong_Type) {
@@ -924,7 +924,7 @@ qint64 PythonQtConv::PyObjGetLongLong(PyObject* val, bool strict, bool &ok) {
924924
} else if (!strict) {
925925
if (PyObject_TypeCheck(val, &PyLong_Type)) {
926926
// support for derived int classes, e.g. for our enums
927-
d = PyInt_AS_LONG(val);
927+
d = PyLong_AS_LONG(val);
928928
} else if (val->ob_type == &PyFloat_Type) {
929929
d = floor(PyFloat_AS_DOUBLE(val));
930930
} else if (val == Py_False) {
@@ -954,7 +954,7 @@ quint64 PythonQtConv::PyObjGetULongLong(PyObject* val, bool strict, bool &ok) {
954954
} else if (!strict) {
955955
if (PyObject_TypeCheck(val, &PyLong_Type)) {
956956
// support for derived int classes, e.g. for our enums
957-
d = PyInt_AS_LONG(val);
957+
d = PyLong_AS_LONG(val);
958958
} else if (val->ob_type == &PyFloat_Type) {
959959
d = floor(PyFloat_AS_DOUBLE(val));
960960
} else if (val == Py_False) {

src/PythonQtPythonInclude.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@
126126
#define PyString_FromFormat PyUnicode_FromFormat
127127
#define PyString_Check PyUnicode_Check
128128

129-
#define PyInt_AS_LONG PyLong_AS_LONG
130129
#define PyInt_Check PyLong_Check
131130
#define PyInt_AsLong PyLong_AsLong
132131

0 commit comments

Comments
 (0)