]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
lex.c (java_init_lex): Avoid incorrect hardcoded constant 11.
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>
Thu, 27 Jun 2002 01:03:24 +0000 (01:03 +0000)
committerKaveh Ghazi <ghazi@gcc.gnu.org>
Thu, 27 Jun 2002 01:03:24 +0000 (01:03 +0000)
* lex.c (java_init_lex): Avoid incorrect hardcoded constant 11.
* parse.y (mark_parser_ctxt): Likewise.

From-SVN: r55016

gcc/java/ChangeLog
gcc/java/lex.c
gcc/java/parse.y

index e7a82e451bbff6a95f9385b99adde266f27f91da..fe89b75b5918a14e69fae400b036d74e5832b9f7 100644 (file)
@@ -1,5 +1,8 @@
 2002-06-26  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
+       * lex.c (java_init_lex): Avoid incorrect hardcoded constant 11.
+       * parse.y (mark_parser_ctxt): Likewise.
+
        * lex.c (java_read_char): Avoid "comparison is always true"
        warning.
 
index 3810096e15d3523c461eb868302f4fa09e885c9d..d350e99907a7701acf815ff683c521fd2ef98b08 100644 (file)
@@ -128,7 +128,7 @@ java_init_lex (finput, encoding)
   CPC_INITIALIZER_LIST (ctxp) = CPC_STATIC_INITIALIZER_LIST (ctxp) =
     CPC_INSTANCE_INITIALIZER_LIST (ctxp) = NULL_TREE;
 
-  memset ((PTR) ctxp->modifier_ctx, 0, 11*sizeof (ctxp->modifier_ctx[0]));
+  memset ((PTR) ctxp->modifier_ctx, 0, sizeof (ctxp->modifier_ctx));
   memset ((PTR) current_jcf, 0, sizeof (JCF));
   ctxp->current_parsed_class = NULL;
   ctxp->package = NULL_TREE;
index 7f373846aabd1cc37f99f26335bc6b089ce31ad2..f0647821ee13caff67a0b7b0b847225d05a9332d 100644 (file)
@@ -16148,13 +16148,15 @@ mark_parser_ctxt (p)
      void *p;
 {
   struct parser_ctxt *pc = *((struct parser_ctxt **) p);
-  int i;
+#ifndef JC1_LITE
+  size_t i;
+#endif
 
   if (!pc)
     return;
 
 #ifndef JC1_LITE
-  for (i = 0; i < 11; ++i)
+  for (i = 0; i < ARRAY_SIZE (pc->modifier_ctx); ++i)
     ggc_mark_tree (pc->modifier_ctx[i]);
   ggc_mark_tree (pc->class_type);
   ggc_mark_tree (pc->function_decl);