Commit 33780b45 by Kaveh R. Ghazi Committed by Kaveh Ghazi

parse.y (check_modifiers, [...]): Avoid incorrect hardcoded constant 10.

	* parse.y (check_modifiers, declare_local_variables): Avoid
	incorrect hardcoded constant 10.

From-SVN: r55017
parent 57ddd19c
......@@ -2,6 +2,8 @@
* lex.c (java_init_lex): Avoid incorrect hardcoded constant 11.
* parse.y (mark_parser_ctxt): Likewise.
(check_modifiers, declare_local_variables): Avoid incorrect
hardcoded constant 10.
* lex.c (java_read_char): Avoid "comparison is always true"
warning.
......
......@@ -440,8 +440,8 @@ static GTY(()) tree src_parse_roots[1];
#define check_modifiers(__message, __value, __mask) do { \
if ((__value) & ~(__mask)) \
{ \
int i, remainder = (__value) & ~(__mask); \
for (i = 0; i <= 10; i++) \
size_t i, remainder = (__value) & ~(__mask); \
for (i = 0; i < ARRAY_SIZE (ctxp->modifier_ctx); i++) \
if ((1 << i) & remainder) \
parse_error_context (ctxp->modifier_ctx [i], (__message), \
java_accstring_lookup (1 << i)); \
......@@ -7248,8 +7248,10 @@ declare_local_variables (modifier, type, vlist)
if (modifier)
{
int i;
for (i = 0; i <= 10; i++) if (1 << i & modifier) break;
size_t i;
for (i = 0; i < ARRAY_SIZE (ctxp->modifier_ctx); i++)
if (1 << i & modifier)
break;
if (modifier == ACC_FINAL)
final_p = 1;
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment