Fix formatting.
authorNick Clifton <nickc@redhat.com>
Mon, 3 Jul 2000 21:52:37 +0000 (21:52 +0000)
committerNick Clifton <nickc@redhat.com>
Mon, 3 Jul 2000 21:52:37 +0000 (21:52 +0000)
opcodes/ChangeLog
opcodes/h8300-dis.c
opcodes/h8500-dis.c

index 8be6f0cbec934321f3a5b28992a2479293795df9..ad3860082c2c0b308070710d3c82e5b959427e21 100644 (file)
@@ -1,3 +1,8 @@
+2000-07-03  Kazu Hirata  <kazu@hxi.com>
+
+       * h8300-dis.c (bfd_h8_disassemble): Improve readability.
+       * h8500-dis.c: Fix formatting.
+
 2000-07-01  Alan Modra  <alan@linuxcare.com.au>
 
        * Makefile.am (DEP): Fix 2000-06-22.  grep after running dep.sed
index 489aa8ccef40a195974fdc180b11db2a11c40731..61350b0d59417f1df77fcaa847492955a92098c9 100644 (file)
@@ -87,7 +87,7 @@ bfd_h8_disassemble (addr, info, mode)
   int bit = 0;
   int plen = 0;
   static boolean init = 0;
-  struct h8_opcode *q = h8_opcodes;
+  struct h8_opcode *q;
   char CONST **pregnames = mode != 0 ? lregnames : wregnames;
   int status;
   int l;
@@ -112,13 +112,11 @@ bfd_h8_disassemble (addr, info, mode)
     status = info->read_memory_func (addr + l, data + l, 2, info);
 
   /* Find the exact opcode/arg combo.  */
-  while (q->name)
+  for (q = h8_opcodes; q->name; q++)
     {
-      op_type *nib;
+      op_type *nib = q->data.nib;
       unsigned int len = 0;
 
-      nib = q->data.nib;
-
       while (1)
        {
          op_type looking_for = *nib;
@@ -398,7 +396,7 @@ bfd_h8_disassemble (addr, info, mode)
        }
 
     fail:
-      q++;
+      ;
     }
 
   /* Fell off the end.  */
index d5e15d4fdb62c4b96cc7d841a2a6e5caf1bf557c..802827eb8d56cf7fa49452609a91ed69cae3fbe7 100644 (file)
@@ -69,8 +69,7 @@ fetch_data (info, addr)
   return 1;
 }
 
-static char *crname[] =
-{"sr", "ccr", "*", "br", "ep", "dp", "*", "tp"};
+static char *crname[] = { "sr", "ccr", "*", "br", "ep", "dp", "*", "tp" };
 
 int
 print_insn_h8500 (addr, info)
@@ -91,21 +90,22 @@ print_insn_h8500 (addr, info)
     /* Error return.  */
     return -1;
 
-if (0)  {
-    static    int one;
-    if (!one ) 
-      {
-       one = 1;
-       for (opcode = h8500_table; opcode->name; opcode++)
-         {
-           if ((opcode->bytes[0].contents & 0x8) == 0)
-             printf("%s\n", opcode->name);
-         }
-      }
-  }
+  if (0)
+    {
+      static int one;
 
+      if (!one)
+       {
+         one = 1;
+         for (opcode = h8500_table; opcode->name; opcode++)
+           {
+             if ((opcode->bytes[0].contents & 0x8) == 0)
+               printf ("%s\n", opcode->name);
+           }
+       }
+    }
 
-  /* Run down the table to find the one which matches */
+  /* Run down the table to find the one which matches */
   for (opcode = h8500_table; opcode->name; opcode++)
     {
       int byte;
@@ -119,6 +119,7 @@ if (0)  {
       int qim = 0;
       int i;
       int cr = 0;
+
       for (byte = 0; byte < opcode->length; byte++)
        {
          FETCH_DATA (info, buffer + byte + 1);
@@ -129,7 +130,7 @@ if (0)  {
            }
          else
            {
-             /* extract any info parts */
+             /* Extract any info parts.  */
              switch (opcode->bytes[byte].insert)
                {
                case 0:
@@ -221,8 +222,8 @@ if (0)  {
                }
            }
        }
-      /* We get here when all the masks have passed so we can output the
-        operands*/
+      /* We get here when all the masks have passed so we can output
+        the operands.  */
       FETCH_DATA (info, buffer + opcode->length);
       for (i = 0; i < opcode->length; i++)
        {
@@ -322,7 +323,8 @@ if (0)  {
              func (stream, "#0x%0x:8", imm & 0xff);
              break;
            case PCREL16:
-             func (stream, "0x%0x:16", (pcrel + addr + opcode->length) & 0xffff);
+             func (stream, "0x%0x:16",
+                   (pcrel + addr + opcode->length) & 0xffff);
              break;
            case PCREL8:
              func (stream, "#0x%0x:8",
@@ -337,12 +339,12 @@ if (0)  {
            }
        }
       return opcode->length;
-    next:;
+    next:
+      ;
     }
 
-  /* Couldn't understand anything */
+  /* Couldn't understand anything */
   /* xgettext:c-format */
   func (stream, _("%02x\t\t*unknown*"), buffer[0]);
   return 1;
-
 }
This page took 0.029646 seconds and 4 git commands to generate.