Use the new Py_ARRAY_LENGTH macro

This commit is contained in:
Victor Stinner 2011-09-29 00:42:28 +02:00
parent b9dcffb51e
commit 639418812f
15 changed files with 26 additions and 28 deletions

View file

@ -1044,7 +1044,7 @@ static int _PyCodecRegistry_Init(void)
interp->codec_error_registry = PyDict_New();
if (interp->codec_error_registry) {
for (i = 0; i < sizeof(methods)/sizeof(methods[0]); ++i) {
for (i = 0; i < Py_ARRAY_LENGTH(methods); ++i) {
PyObject *func = PyCFunction_New(&methods[i].def, NULL);
int res;
if (!func)