diff options
author | Benjamin Peterson <benjamin@python.org> | 2016-09-07 18:28:35 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2016-09-07 18:28:35 (GMT) |
commit | 1bf494b0ec74fcdca8bd93c1e679ec5d3b6a5a5c (patch) | |
tree | 77ffd55ff06bc00af4405f24fe026fb81b1cb59a | |
parent | 5c4de2863b217338deb9a0fcd20b202b8647b366 (diff) | |
download | cpython-1bf494b0ec74fcdca8bd93c1e679ec5d3b6a5a5c.zip cpython-1bf494b0ec74fcdca8bd93c1e679ec5d3b6a5a5c.tar.gz cpython-1bf494b0ec74fcdca8bd93c1e679ec5d3b6a5a5c.tar.bz2 |
use a the bool type for a boolean variable
-rw-r--r-- | Objects/codeobject.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Objects/codeobject.c b/Objects/codeobject.c index 98e504a..c8abda2 100644 --- a/Objects/codeobject.c +++ b/Objects/codeobject.c @@ -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; } } |