summaryrefslogtreecommitdiff
path: root/gcc/cpplex.c
diff options
context:
space:
mode:
authordanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2001-03-02 01:11:50 +0000
committerdanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>2001-03-02 01:11:50 +0000
commitee6c4e4b27bfcd3a4de817cf3d37c8c4ef72770a (patch)
treeda9ac0ba27ed4ebd50b3f9958d9ae1f81ef897f5 /gcc/cpplex.c
parenta45495831fc0a10be05ced025adc81e8224a608e (diff)
downloadgcc-ee6c4e4b27bfcd3a4de817cf3d37c8c4ef72770a.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@40174 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpplex.c')
-rw-r--r--gcc/cpplex.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gcc/cpplex.c b/gcc/cpplex.c
index 9025b0531a8..1d98b056a63 100644
--- a/gcc/cpplex.c
+++ b/gcc/cpplex.c
@@ -1321,7 +1321,8 @@ cpp_spell_token (pfile, token, buffer)
unsigned char c;
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)
goto spell_ident;
else
@@ -1413,7 +1414,8 @@ cpp_output_token (token, fp)
const unsigned char *spelling;
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)
goto spell_ident;
else
@@ -1523,8 +1525,8 @@ cpp_can_paste (pfile, token1, token2, digraph)
if (token2->flags & NAMED_OP)
b = CPP_NAME;
- if (a <= CPP_LAST_EQ && b == CPP_EQ)
- return a + (CPP_EQ_EQ - CPP_EQ);
+ if ((int) a <= (int) CPP_LAST_EQ && b == CPP_EQ)
+ return (enum cpp_ttype) ((int) a + ((int) CPP_EQ_EQ - (int) CPP_EQ));
switch (a)
{
@@ -1637,12 +1639,12 @@ cpp_avoid_paste (pfile, token1, token2)
c = EOF;
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)
c = token_spellings[b].name[0];
/* Quickly get everything that can paste with an '='. */
- if (a <= CPP_LAST_EQ && c == '=')
+ if ((int) a <= (int) CPP_LAST_EQ && c == '=')
return 1;
switch (a)