Commit 37b8524c by John David Anglin Committed by John David Anglin

cpplib.c (_cpp_init_stacks): Cast enum for comparison.

	* cpplib.c (_cpp_init_stacks): Cast enum for comparison.
	* cppexp.c (lex): Cast enums for comparison.
	* cppinit.c (parse_option): Cast enum for comparison.
	* cpplex.c (cpp_spell_token): Cast enums to int for minus.
	(cpp_output_token): Likewise.
	(cpp_can_paste): Cast enums for comparsion and plus/minus.
	(cpp_avoid_paste): Cast enums for minus and comparison.

From-SVN: r40174
parent f7143427
2001-03-01 John David Anglin <dave@hiauly1.hia.nrc.ca>
* cpplib.c (_cpp_init_stacks): Cast enum for comparison.
* cppexp.c (lex): Cast enums for comparison.
* cppinit.c (parse_option): Cast enum for comparison.
* cpplex.c (cpp_spell_token): Cast enums to int for minus.
(cpp_output_token): Likewise.
(cpp_can_paste): Cast enums for comparsion and plus/minus.
(cpp_avoid_paste): Cast enums for minus and comparison.
2001-03-01 Zack Weinberg <zackw@stanford.edu> 2001-03-01 Zack Weinberg <zackw@stanford.edu>
* gcc.c, objc/lang-specs.h: Add zero initializer for cpp_spec * gcc.c, objc/lang-specs.h: Add zero initializer for cpp_spec
......
...@@ -477,7 +477,8 @@ lex (pfile, skip_evaluation, token) ...@@ -477,7 +477,8 @@ lex (pfile, skip_evaluation, token)
/* Fall through. */ /* Fall through. */
default: default:
if ((token->type > CPP_EQ && token->type < CPP_PLUS_EQ) if (((int) token->type > (int) CPP_EQ
&& (int) token->type < (int) CPP_PLUS_EQ)
|| token->type == CPP_EOF) || token->type == CPP_EOF)
{ {
op.op = token->type; op.op = token->type;
......
...@@ -1191,7 +1191,7 @@ parse_option (input) ...@@ -1191,7 +1191,7 @@ parse_option (input)
Otherwise, return the longest option-accepting match. Otherwise, return the longest option-accepting match.
This loops no more than twice with current options. */ This loops no more than twice with current options. */
mx = md; mx = md;
for (; mn < N_OPTS; mn++) for (; mn < (unsigned int) N_OPTS; mn++)
{ {
opt_len = cl_options[mn].opt_len; opt_len = cl_options[mn].opt_len;
if (memcmp (input, cl_options[mn].opt_text, opt_len)) if (memcmp (input, cl_options[mn].opt_text, opt_len))
......
...@@ -1321,7 +1321,8 @@ cpp_spell_token (pfile, token, buffer) ...@@ -1321,7 +1321,8 @@ cpp_spell_token (pfile, token, buffer)
unsigned char c; unsigned char c;
if (token->flags & DIGRAPH) if (token->flags & DIGRAPH)
spelling = digraph_spellings[token->type - CPP_FIRST_DIGRAPH]; spelling
= digraph_spellings[(int) token->type - (int) CPP_FIRST_DIGRAPH];
else if (token->flags & NAMED_OP) else if (token->flags & NAMED_OP)
goto spell_ident; goto spell_ident;
else else
...@@ -1413,7 +1414,8 @@ cpp_output_token (token, fp) ...@@ -1413,7 +1414,8 @@ cpp_output_token (token, fp)
const unsigned char *spelling; const unsigned char *spelling;
if (token->flags & DIGRAPH) if (token->flags & DIGRAPH)
spelling = digraph_spellings[token->type - CPP_FIRST_DIGRAPH]; spelling
= digraph_spellings[(int) token->type - (int) CPP_FIRST_DIGRAPH];
else if (token->flags & NAMED_OP) else if (token->flags & NAMED_OP)
goto spell_ident; goto spell_ident;
else else
...@@ -1523,8 +1525,8 @@ cpp_can_paste (pfile, token1, token2, digraph) ...@@ -1523,8 +1525,8 @@ cpp_can_paste (pfile, token1, token2, digraph)
if (token2->flags & NAMED_OP) if (token2->flags & NAMED_OP)
b = CPP_NAME; b = CPP_NAME;
if (a <= CPP_LAST_EQ && b == CPP_EQ) if ((int) a <= (int) CPP_LAST_EQ && b == CPP_EQ)
return a + (CPP_EQ_EQ - CPP_EQ); return (enum cpp_ttype) ((int) a + ((int) CPP_EQ_EQ - (int) CPP_EQ));
switch (a) switch (a)
{ {
...@@ -1637,12 +1639,12 @@ cpp_avoid_paste (pfile, token1, token2) ...@@ -1637,12 +1639,12 @@ cpp_avoid_paste (pfile, token1, token2)
c = EOF; c = EOF;
if (token2->flags & DIGRAPH) if (token2->flags & DIGRAPH)
c = digraph_spellings[b - CPP_FIRST_DIGRAPH][0]; c = digraph_spellings[(int) b - (int) CPP_FIRST_DIGRAPH][0];
else if (token_spellings[b].category == SPELL_OPERATOR) else if (token_spellings[b].category == SPELL_OPERATOR)
c = token_spellings[b].name[0]; c = token_spellings[b].name[0];
/* Quickly get everything that can paste with an '='. */ /* Quickly get everything that can paste with an '='. */
if (a <= CPP_LAST_EQ && c == '=') if ((int) a <= (int) CPP_LAST_EQ && c == '=')
return 1; return 1;
switch (a) switch (a)
......
...@@ -1879,7 +1879,7 @@ _cpp_init_stacks (pfile) ...@@ -1879,7 +1879,7 @@ _cpp_init_stacks (pfile)
obstack_init (pfile->buffer_ob); obstack_init (pfile->buffer_ob);
/* Register the directives. */ /* Register the directives. */
for (i = 0; i < N_DIRECTIVES; i++) for (i = 0; i < (unsigned int) N_DIRECTIVES; i++)
{ {
node = cpp_lookup (pfile, dtable[i].name, dtable[i].length); node = cpp_lookup (pfile, dtable[i].name, dtable[i].length);
node->directive_index = i + 1; node->directive_index = i + 1;
......
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