run "make dep-am"
[binutils-gdb.git] / opcodes / maxq-dis.c
index b3a7c4678c513dcb7f713c32a5d3de43c66df3d8..d9977ea30677bdce5db8241509c01951386224c0 100644 (file)
@@ -1,25 +1,25 @@
 /* Instruction printing code for the MAXQ
 
-   Copyright 2004 Free Software Foundation, Inc.
+   Copyright 2004, 2005, 2007 Free Software Foundation, Inc.
 
    Written by Vineet Sharma(vineets@noida.hcltech.com) Inderpreet
    S.(inderpreetb@noida.hcltech.com)
 
-   This file is part of GDB.
+   This file is part of the GNU opcodes library.
 
-   This program is free software; you can redistribute it and/or modify it
-   under the terms of the GNU General Public License as published by the Free 
-   Software Foundation; either version 2 of the License, or (at your option)
+   This library is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3, or (at your option)
    any later version.
 
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
-   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-   for more details.
+   It is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
 
    You should have received a copy of the GNU General Public License along
-   with this program; if not, write to the Free Software Foundation, Inc., 59 
-   Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+   with this program; if not, write to the Free Software Foundation, Inc., 
+   51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
 
 #include "sysdep.h"
 #include "dis-asm.h"
@@ -145,9 +145,9 @@ unsigned char const SIM_ALU_DECODE_POP_OP_GROUP = 10;
 unsigned char const SIM_ALU_DECODE_CMP_SRC_OP_GROUP = 11;
 
 /* GLOBAL */
-unsigned char unres_reg_name[20];
+char unres_reg_name[20];
 
-static unsigned char *
+static char *
 get_reg_name (unsigned char reg_code, type1 arg_pos)
 {
   unsigned char module;
@@ -182,7 +182,7 @@ get_reg_name (unsigned char reg_code, type1 arg_pos)
       if (reg_code == mem_acc->opcode)
        {
          for (syntax = mem_access_syntax_table;
-              mem_access_syntax_table != NULL || mem_access_syntax_table->name;
+              syntax != NULL && syntax->name;
               ++syntax)
            if (!strcmp (mem_acc->name, syntax->name))
              {
@@ -358,8 +358,8 @@ get_group (const unsigned int insn)
 
   if ((insn & _DECODE_LOWNIB_HIGHBYTE) == 0x0A00)
     {
-      /* && condition with sec part added on 26 May for resoveing 2 & 3 grp
-         conflict.  */
+      /* && condition with sec part added on 26 May for resolving 2 & 3 grp
+        conflict.  */
       if (((insn & _DECODE_LOWNIB_LOWBYTE) == 0x000A)
          && ((insn & _DECODE_GET_F_HIGHBYTE) == 0x8000))
        {
@@ -652,7 +652,8 @@ print_insn (bfd_vma memaddr, struct disassemble_info *info,
                                      grp.bit_no);
                }
              else
-               info->fprintf_func (info->stream, " %s", get_reg_name (grp.dst, (type1) 0));
+               info->fprintf_func (info->stream, " %s",
+                                   get_reg_name (grp.dst, (type1) 0));
            }
 
          /* SRC is ABSENT in the grp.  */
@@ -682,7 +683,7 @@ print_insn (bfd_vma memaddr, struct disassemble_info *info,
                                        grp.bit_no);
                  if (format == 0)
                    info->fprintf_func (info->stream, " #%02xh.%d",
-                                       (grp.src, SRC), grp.bit_no);
+                                       grp.src, grp.bit_no);
                }
              else
                {
@@ -692,11 +693,11 @@ print_insn (bfd_vma memaddr, struct disassemble_info *info,
                    format = grp.fbit;
                  if (format == 1)
                    info->fprintf_func (info->stream, " %s",
-                                          get_reg_name (grp.src,
-                                                        (type1) 1 /*SRC*/));
+                                       get_reg_name (grp.src,
+                                                     (type1) 1 /*SRC*/));
                  if (format == 0)
                    info->fprintf_func (info->stream, " #%02xh",
-                                          (grp.src));
+                                       (grp.src));
                }
            }
 
@@ -705,7 +706,7 @@ print_insn (bfd_vma memaddr, struct disassemble_info *info,
     }
 
   info->fprintf_func (info->stream, "Unable to Decode :  %02x %02x",
-                        insn[0], insn[1]);
+                     insn[0], insn[1]);
   return 2;                    
 }
 
@@ -714,4 +715,3 @@ print_insn_maxq_little (bfd_vma memaddr, struct disassemble_info *info)
 {
   return print_insn (memaddr, info, BFD_ENDIAN_LITTLE);
 }
-