[gimplefe] Fix C++ warnings in gimple/parser.c

Submitted by Diego Novillo on Jan. 24, 2011, 3:05 p.m.

Details

Message ID 20110124150520.GA20958@google.com
State New
Headers show

Commit Message

Diego Novillo Jan. 24, 2011, 3:05 p.m.
A silly oversight from my previous patch.  Bootstrapped on
x86_64.

Committed to branch.

	* gimple/parser.c (gl_tree_code_for_token): Fix type
	mismatch warnings.
	(gl_gimple_code_for_token): Likewise.

Patch hide | download patch | download mbox

Index: gimple/parser.c
===================================================================
--- gimple/parser.c	(revision 169160)
+++ gimple/parser.c	(working copy)
@@ -95,7 +95,7 @@  gl_consume_token (gimple_lexer *lexer)
 static enum tree_code
 gl_tree_code_for_token (const gimple_token *token)
 {
-  enum tree_code code;
+  size_t code;
   const char *s;
 
   s = gl_token_as_text (token);
@@ -103,7 +103,7 @@  gl_tree_code_for_token (const gimple_tok
     if (strcasecmp (s, tree_code_name[code]) == 0)
       break;
 
-  return code;
+  return (enum tree_code) code;
 }
 
 
@@ -113,7 +113,7 @@  gl_tree_code_for_token (const gimple_tok
 static enum gimple_code
 gl_gimple_code_for_token (const gimple_token *token)
 {
-  enum gimple_code code;
+  size_t code;
   const char *s;
 
   s = gl_token_as_text (token);
@@ -121,7 +121,7 @@  gl_gimple_code_for_token (const gimple_t
     if (strcasecmp (s, gimple_code_name[code]) == 0)
       break;
 
-  return code;
+  return (enum gimple_code) code;
 }