Use the new Py_ARRAY_LENGTH macro
diff --git a/Python/codecs.c b/Python/codecs.c
index be2e833..4c2fc5d 100644
--- a/Python/codecs.c
+++ b/Python/codecs.c
@@ -1044,7 +1044,7 @@
     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)
diff --git a/Python/dynload_aix.c b/Python/dynload_aix.c
index 74c7b32..6287c86 100644
--- a/Python/dynload_aix.c
+++ b/Python/dynload_aix.c
@@ -129,7 +129,6 @@
         {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 @@
     }
     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);
         }
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index dea2149..3576ced 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -1771,7 +1771,7 @@
         the argument must be the full path anyway. */
         wchar_t *ptemp;
         if (GetFullPathNameW(argv0,
-                           sizeof(fullpath)/sizeof(fullpath[0]),
+                           Py_ARRAY_LENGTH(fullpath),
                            fullpath,
                            &ptemp)) {
             argv0 = fullpath;