Skip to content

Commit 0df96b1

Browse files
authored
Address unused variable warning on GIL-enabled builds (#202)
This integer variable is only used when the GIL is disabled in the build i.e. for free-threaded builds. Otherwise it will cause the compiler to emit an unused variable warning.
1 parent bd69b85 commit 0df96b1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/c/realize_c_type.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ static PyObject *build_primitive_type(int num); /* forward */
2929
static int init_global_types_dict(PyObject *ffi_type_dict)
3030
{
3131
int err;
32-
Py_ssize_t i;
3332
PyObject *ct_void, *ct_char, *ct2, *pnull;
3433
/* XXX some leaks in case these functions fail, but well,
3534
MemoryErrors during importing an extension module are kind
@@ -78,7 +77,7 @@ static int init_global_types_dict(PyObject *ffi_type_dict)
7877
#ifdef Py_GIL_DISABLED
7978
// Ensure that all primitive types are initialised to avoid race conditions
8079
// on the first access.
81-
for (i = 0; i < _CFFI__NUM_PRIM; i++) {
80+
for (Py_ssize_t i = 0; i < _CFFI__NUM_PRIM; i++) {
8281
ct2 = get_primitive_type(i);
8382
if (ct2 == NULL)
8483
return -1;

0 commit comments

Comments
 (0)