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
|
@ -129,7 +129,6 @@ aix_loaderror(const char *pathname)
|
|||
{L_ERROR_ERRNO, NULL}
|
||||
};
|
||||
|
||||
#define LOAD_ERRTAB_LEN (sizeof(load_errtab)/sizeof(load_errtab[0]))
|
||||
#define ERRBUF_APPEND(s) strncat(errbuf, s, sizeof(errbuf)-strlen(errbuf)-1)
|
||||
|
||||
PyOS_snprintf(errbuf, sizeof(errbuf), "from module %.200s ", pathname);
|
||||
|
@ -140,7 +139,7 @@ aix_loaderror(const char *pathname)
|
|||
}
|
||||
for(i = 0; message[i] && *message[i]; i++) {
|
||||
int nerr = atoi(message[i]);
|
||||
for (j=0; j<LOAD_ERRTAB_LEN ; j++) {
|
||||
for (j=0; j < Py_ARRAY_LENGTH(load_errtab); j++) {
|
||||
if (nerr == load_errtab[j].errNo && load_errtab[j].errstr)
|
||||
ERRBUF_APPEND(load_errtab[j].errstr);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue