Skip to content

Commit b070ad5

Browse files
Arrange pointer_type declaration
1 parent 2f9285f commit b070ad5

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Modules/_ctypes/_ctypes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,8 @@ CType_Type_traverse(PyObject *self, visitproc visit, void *arg)
473473
Py_VISIT(info->converters);
474474
Py_VISIT(info->restype);
475475
Py_VISIT(info->checker);
476-
Py_VISIT(info->module);
477476
Py_VISIT(info->pointer_type);
477+
Py_VISIT(info->module);
478478
}
479479
Py_VISIT(Py_TYPE(self));
480480
return PyType_Type.tp_traverse(self, visit, arg);

Modules/_ctypes/ctypes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,7 @@ typedef struct {
364364
PyObject *converters; /* tuple([t.from_param for t in argtypes]) */
365365
PyObject *restype; /* CDataObject or NULL */
366366
PyObject *checker;
367+
PyObject *pointer_type;
367368
PyObject *module;
368369
int flags; /* calling convention and such */
369370

@@ -373,7 +374,6 @@ typedef struct {
373374
Py_ssize_t *shape;
374375
/* Py_ssize_t *strides; */ /* unused in ctypes */
375376
/* Py_ssize_t *suboffsets; */ /* unused in ctypes */
376-
PyObject *pointer_type;
377377
} StgInfo;
378378

379379
extern int PyCStgInfo_clone(StgInfo *dst_info, StgInfo *src_info);
@@ -566,8 +566,8 @@ PyStgInfo_Init(ctypes_state *state, PyTypeObject *type)
566566
if (!module) {
567567
return NULL;
568568
}
569-
info->module = Py_NewRef(module);
570569
info->pointer_type = NULL;
570+
info->module = Py_NewRef(module);
571571

572572
info->initialized = 1;
573573
return info;

Modules/_ctypes/stgdict.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ PyCStgInfo_clone(StgInfo *dst_info, StgInfo *src_info)
4040
Py_XINCREF(dst_info->converters);
4141
Py_XINCREF(dst_info->restype);
4242
Py_XINCREF(dst_info->checker);
43-
Py_XINCREF(dst_info->module);
4443
Py_XINCREF(dst_info->pointer_type);
44+
Py_XINCREF(dst_info->module);
4545

4646
if (src_info->format) {
4747
dst_info->format = PyMem_Malloc(strlen(src_info->format) + 1);

0 commit comments

Comments
 (0)