diff options
Diffstat (limited to 'gcc/genhooks.cc')
-rw-r--r-- | gcc/genhooks.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/genhooks.cc b/gcc/genhooks.cc index 20ad607..6bae85d 100644 --- a/gcc/genhooks.cc +++ b/gcc/genhooks.cc @@ -128,7 +128,7 @@ emit_documentation (const char *in_fname) } fclose (f); /* For each hook in hook_array, if it is a start hook, store its position. */ - for (i = 0; i < (int) (sizeof hook_array / sizeof hook_array[0]); i++) + for (i = 0; i < (int) (ARRAY_SIZE (hook_array)); i++) { struct s_hook sh, *shp; void *p; @@ -223,7 +223,7 @@ emit_documentation (const char *in_fname) /* POD-valued hooks sometimes come in groups with common documentation.*/ for (j = i + 1; - j < (int) (sizeof hook_array / sizeof hook_array[0]) + j < (int) (ARRAY_SIZE (hook_array)) && hook_array[j].doc == 0 && hook_array[j].type; j++) { char *namex = upstrdup (hook_array[j].name); @@ -246,8 +246,7 @@ emit_documentation (const char *in_fname) printf ("\n@end %s", deftype); } } - if (++i >= (int) (sizeof hook_array / sizeof hook_array[0]) - || !hook_array[i].doc) + if (++i >= (int) (ARRAY_SIZE (hook_array)) || !hook_array[i].doc) break; free (name); sh.name = name = upstrdup (hook_array[i].name); @@ -270,7 +269,7 @@ emit_init_macros (const char *docname) for (print_nest = 0; print_nest <= MAX_NEST; print_nest++) { - for (i = 0; i < (int) (sizeof hook_array / sizeof hook_array[0]); i++) + for (i = 0; i < (int) (ARRAY_SIZE (hook_array)); i++) { char *name = upstrdup (hook_array[i].name); |