OSDN Git Service

* mep.opc: Apply patches from opcodes to compile with -Wshadow. cgen-snapshot-20100101
authordevans <devans>
Fri, 18 Dec 2009 15:04:33 +0000 (15:04 +0000)
committerdevans <devans>
Fri, 18 Dec 2009 15:04:33 +0000 (15:04 +0000)
mep-asm.c now regenerates correctly again.

cgen/ChangeLog
cgen/cpu/mep.opc

index 7e12fab..02b207c 100644 (file)
@@ -1,5 +1,8 @@
 2009-12-17  Doug Evans  <dje@sebabeach.org>
 
+       * mep.opc: Apply patches from opcodes to compile with -Wshadow.
+       mep-asm.c now regenerates correctly again.
+       
        * gen-all: Add support for building gcc/newlib.
        Specify --prefix and install all built tools.
 
index 9f99584..0afcd9a 100644 (file)
@@ -661,7 +661,7 @@ expand_macro (arg *args, int narg, macro *mac)
   char *result = 0, *rescanned_result = 0;
   char *e = mac->expansion;
   char *mark = e;
-  int arg = 0;
+  int mac_arg = 0;
 
   /*  printf("expanding macro %s with %d args\n", mac->name, narg + 1); */
   while (*e)
@@ -672,9 +672,9 @@ expand_macro (arg *args, int narg, macro *mac)
          ((*(e + 1) - '1') <= narg))
        {
          result = str_append (result, mark, e - mark);
-         arg = (*(e + 1) - '1');
-         /* printf("replacing `%d with %s\n", arg+1, args[arg].start); */
-         result = str_append (result, args[arg].start, args[arg].len);
+         mac_arg = (*(e + 1) - '1');
+         /* printf("replacing `%d with %s\n", mac_arg+1, args[mac_arg].start); */
+         result = str_append (result, args[mac_arg].start, args[mac_arg].len);
          ++e;
          mark = e+1;
        }
@@ -706,8 +706,7 @@ expand_string (const char *in, int first_only)
   arg args[MAXARGS];
   int state = IN_TEXT;
   const char *mark = in;
-  macro *macro = 0;
-
+  macro *pmacro = NULL;
   char *expansion = 0;
   char *result = 0;
 
@@ -718,18 +717,18 @@ expand_string (const char *in, int first_only)
        case IN_TEXT:
          if (*in == '%' && *(in + 1) && (!first_only || num_expansions == 0)) 
            {         
-             macro = lookup_macro (in + 1);
-             if (macro)
+             pmacro = lookup_macro (in + 1);
+             if (pmacro)
                {
                  /* printf("entering state %d at '%s'...\n", state, in); */
                  result = str_append (result, mark, in - mark);
                  mark = in;
-                 in += 1 + strlen (macro->name);
+                 in += 1 + strlen (pmacro->name);
                  while (*in == ' ') ++in;
                  if (*in != '(')
                    {
                      state = IN_TEXT;                
-                     macro = 0;
+                     pmacro = NULL;
                    }
                  else
                    {
@@ -755,10 +754,10 @@ expand_string (const char *in, int first_only)
                case ')':
                  state = IN_TEXT;
                  /* printf("entering state %d at '%s'...\n", state, in); */
-                 if (macro)
+                 if (pmacro)
                    {
                      expansion = 0;
-                     expansion = expand_macro (args, narg, macro);
+                     expansion = expand_macro (args, narg, pmacro);
                      num_expansions++;
                      if (expansion)
                        {
@@ -770,7 +769,7 @@ expand_string (const char *in, int first_only)
                    {
                      result = str_append (result, mark, in - mark);
                    }
-                 macro = 0;
+                 pmacro = NULL;
                  mark = in + 1;
                  break;
                case '(':