mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Use the new Py_ARRAY_LENGTH macro
This commit is contained in:
parent
b9dcffb51e
commit
639418812f
15 changed files with 26 additions and 28 deletions
|
@ -530,7 +530,7 @@ oss_self(PyObject *self, PyObject *unused)
|
|||
return self;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
static PyObject *
|
||||
oss_exit(PyObject *self, PyObject *unused)
|
||||
{
|
||||
PyObject *ret = PyObject_CallMethod(self, "close", NULL);
|
||||
|
@ -1061,8 +1061,8 @@ build_namelists (PyObject *module)
|
|||
int num_controls;
|
||||
int i;
|
||||
|
||||
num_controls = sizeof(control_labels) / sizeof(control_labels[0]);
|
||||
assert(num_controls == sizeof(control_names) / sizeof(control_names[0]));
|
||||
num_controls = Py_ARRAY_LENGTH(control_labels);
|
||||
assert(num_controls == Py_ARRAY_LENGTH(control_names));
|
||||
|
||||
labels = PyList_New(num_controls);
|
||||
names = PyList_New(num_controls);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue