]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
use a the bool type for a boolean variable
authorBenjamin Peterson <benjamin@python.org>
Wed, 7 Sep 2016 18:28:35 +0000 (11:28 -0700)
committerBenjamin Peterson <benjamin@python.org>
Wed, 7 Sep 2016 18:28:35 +0000 (11:28 -0700)
Objects/codeobject.c

index 98e504a5a92615798a96425d3e670e1ece9acb51..c8abda202b2135f7456a11bcf8e45b0ad2f8e839 100644 (file)
@@ -1,3 +1,5 @@
+#include <stdbool.h>
+
 #include "Python.h"
 #include "code.h"
 #include "structmember.h"
@@ -96,7 +98,7 @@ PyCode_New(int argcount, int kwonlyargcount,
         Py_ssize_t total_args = argcount + kwonlyargcount +
             ((flags & CO_VARARGS) != 0) + ((flags & CO_VARKEYWORDS) != 0);
         Py_ssize_t alloc_size = sizeof(unsigned char) * n_cellvars;
-        int used_cell2arg = 0;
+        bool used_cell2arg = false;
         cell2arg = PyMem_MALLOC(alloc_size);
         if (cell2arg == NULL)
             return NULL;
@@ -109,7 +111,7 @@ PyCode_New(int argcount, int kwonlyargcount,
                 PyObject *arg = PyTuple_GET_ITEM(varnames, j);
                 if (!PyUnicode_Compare(cell, arg)) {
                     cell2arg[i] = j;
-                    used_cell2arg = 1;
+                    used_cell2arg = true;
                     break;
                 }
             }