summaryrefslogtreecommitdiffstats
path: root/Modules/_ctypes
diff options
context:
space:
mode:
authorJeroen Demeyer <J.Demeyer@UGent.be>2019-07-04 10:35:31 (GMT)
committerInada Naoki <songofacandy@gmail.com>2019-07-04 10:35:31 (GMT)
commit7f41c8e0dd237d1f3f0a1d2ba2f3ee4e4bd400a7 (patch)
tree14cc12990e39950f635afd510f813324b8ee444e /Modules/_ctypes
parent196a530e00d88a138973bf9182e013937e293f97 (diff)
downloadcpython-7f41c8e0dd237d1f3f0a1d2ba2f3ee4e4bd400a7.zip
cpython-7f41c8e0dd237d1f3f0a1d2ba2f3ee4e4bd400a7.tar.gz
cpython-7f41c8e0dd237d1f3f0a1d2ba2f3ee4e4bd400a7.tar.bz2
bpo-37493: use _PyObject_CallNoArg in more places (GH-14575)
Diffstat (limited to 'Modules/_ctypes')
-rw-r--r--Modules/_ctypes/_ctypes.c20
-rw-r--r--Modules/_ctypes/cfield.c3
2 files changed, 11 insertions, 12 deletions
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index 2201c45..c6ae487 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -1001,8 +1001,8 @@ PyCPointerType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
stgdict items size, align, length contain info about pointers itself,
stgdict->proto has info about the pointed to type!
*/
- stgdict = (StgDictObject *)PyObject_CallObject(
- (PyObject *)&PyCStgDict_Type, NULL);
+ stgdict = (StgDictObject *)_PyObject_CallNoArg(
+ (PyObject *)&PyCStgDict_Type);
if (!stgdict)
return NULL;
stgdict->size = sizeof(void *);
@@ -1489,8 +1489,8 @@ PyCArrayType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
goto error;
}
- stgdict = (StgDictObject *)PyObject_CallObject(
- (PyObject *)&PyCStgDict_Type, NULL);
+ stgdict = (StgDictObject *)_PyObject_CallNoArg(
+ (PyObject *)&PyCStgDict_Type);
if (!stgdict)
goto error;
@@ -1946,8 +1946,8 @@ static PyObject *CreateSwappedType(PyTypeObject *type, PyObject *args, PyObject
if (result == NULL)
return NULL;
- stgdict = (StgDictObject *)PyObject_CallObject(
- (PyObject *)&PyCStgDict_Type, NULL);
+ stgdict = (StgDictObject *)_PyObject_CallNoArg(
+ (PyObject *)&PyCStgDict_Type);
if (!stgdict) {
Py_DECREF(result);
return NULL;
@@ -2060,8 +2060,8 @@ PyCSimpleType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
goto error;
}
- stgdict = (StgDictObject *)PyObject_CallObject(
- (PyObject *)&PyCStgDict_Type, NULL);
+ stgdict = (StgDictObject *)_PyObject_CallNoArg(
+ (PyObject *)&PyCStgDict_Type);
if (!stgdict)
goto error;
@@ -2454,8 +2454,8 @@ PyCFuncPtrType_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
PyTypeObject *result;
StgDictObject *stgdict;
- stgdict = (StgDictObject *)PyObject_CallObject(
- (PyObject *)&PyCStgDict_Type, NULL);
+ stgdict = (StgDictObject *)_PyObject_CallNoArg(
+ (PyObject *)&PyCStgDict_Type);
if (!stgdict)
return NULL;
diff --git a/Modules/_ctypes/cfield.c b/Modules/_ctypes/cfield.c
index 95367d5..e0a50fd 100644
--- a/Modules/_ctypes/cfield.c
+++ b/Modules/_ctypes/cfield.c
@@ -60,8 +60,7 @@ PyCField_FromDesc(PyObject *desc, Py_ssize_t index,
#define CONT_BITFIELD 2
#define EXPAND_BITFIELD 3
- self = (CFieldObject *)PyObject_CallObject((PyObject *)&PyCField_Type,
- NULL);
+ self = (CFieldObject *)_PyObject_CallNoArg((PyObject *)&PyCField_Type);
if (self == NULL)
return NULL;
dict = PyType_stgdict(desc);