From 6e2aa220c079f5915a1a5a7397bdfd4b4ae54750 Mon Sep 17 00:00:00 2001 From: Greg McGary Date: Thu, 24 Aug 2000 20:34:39 +0000 Subject: [PATCH] lang.c (lang_decode_option): Use ARRAY_SIZE. * lang.c (lang_decode_option): Use ARRAY_SIZE. * parse.y (BINOP_LOOKUP): Likewise. From-SVN: r35951 --- gcc/java/ChangeLog | 5 +++++ gcc/java/lang.c | 5 +---- gcc/java/parse.y | 3 +-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 1addb289e19..a7b75b4d5f8 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +2000-08-24 Greg McGary + + * lang.c (lang_decode_option): Use ARRAY_SIZE. + * parse.y (BINOP_LOOKUP): Likewise. + 2000-08-21 Nix * lang-specs.h: Do not process -o or run the assembler if diff --git a/gcc/java/lang.c b/gcc/java/lang.c index ae038967c68..5f95f2d9c57 100644 --- a/gcc/java/lang.c +++ b/gcc/java/lang.c @@ -232,10 +232,7 @@ lang_decode_option (argc, argv) p += 2; - for (j = 0; - !found - && j < (int)(sizeof (lang_f_options) / sizeof (lang_f_options[0])); - j++) + for (j = 0; !found && j < (int) ARRAY_SIZE (lang_f_options); j++) { if (!strcmp (p, lang_f_options[j].string)) { diff --git a/gcc/java/parse.y b/gcc/java/parse.y index dcebab9d01e..d63d16d64e8 100644 --- a/gcc/java/parse.y +++ b/gcc/java/parse.y @@ -355,8 +355,7 @@ static enum tree_code binop_lookup[19] = EQ_EXPR, NE_EXPR, GT_EXPR, GE_EXPR, LT_EXPR, LE_EXPR, }; #define BINOP_LOOKUP(VALUE) \ - binop_lookup [((VALUE) - PLUS_TK)% \ - (sizeof (binop_lookup) / sizeof (binop_lookup[0]))] + binop_lookup [((VALUE) - PLUS_TK) % ARRAY_SIZE (binop_lookup)] /* This is the end index for binary operators that can also be used in compound assignements. */