Skip to content

Commit 1bf494b

Browse files
committed
use a the bool type for a boolean variable
1 parent 5c4de28 commit 1bf494b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Objects/codeobject.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include <stdbool.h>
2+
13
#include "Python.h"
24
#include "code.h"
35
#include "structmember.h"
@@ -96,7 +98,7 @@ PyCode_New(int argcount, int kwonlyargcount,
9698
Py_ssize_t total_args = argcount + kwonlyargcount +
9799
((flags & CO_VARARGS) != 0) + ((flags & CO_VARKEYWORDS) != 0);
98100
Py_ssize_t alloc_size = sizeof(unsigned char) * n_cellvars;
99-
int used_cell2arg = 0;
101+
bool used_cell2arg = false;
100102
cell2arg = PyMem_MALLOC(alloc_size);
101103
if (cell2arg == NULL)
102104
return NULL;
@@ -109,7 +111,7 @@ PyCode_New(int argcount, int kwonlyargcount,
109111
PyObject *arg = PyTuple_GET_ITEM(varnames, j);
110112
if (!PyUnicode_Compare(cell, arg)) {
111113
cell2arg[i] = j;
112-
used_cell2arg = 1;
114+
used_cell2arg = true;
113115
break;
114116
}
115117
}

0 commit comments

Comments
 (0)