Automatic date update in version.in
[external/binutils.git] / opcodes / mmix-dis.c
index 746e1be..80a58ed 100644 (file)
@@ -1,5 +1,5 @@
 /* mmix-dis.c -- Disassemble MMIX instructions.
-   Copyright 2000, 2001, 2002, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2000-2019 Free Software Foundation, Inc.
    Written by Hans-Peter Nilsson (hp@bitrange.com)
 
    This file is part of the GNU opcodes library.
    Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
    MA 02110-1301, USA.  */
 
+#include "sysdep.h"
 #include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
 #include "opcode/mmix.h"
-#include "dis-asm.h"
+#include "disassemble.h"
 #include "libiberty.h"
 #include "bfd.h"
 #include "opintl.h"
 
-#define BAD_CASE(x)                            \
- do                                            \
-   {                                           \
-     fprintf (stderr,                          \
-             _("Bad case %d (%s) in %s:%d\n"), \
-             x, #x, __FILE__, __LINE__);       \
-     abort ();                                 \
-   }                                           \
+#define BAD_CASE(x)                                            \
+  do                                                           \
+   {                                                           \
+     opcodes_error_handler (_("bad case %d (%s) in %s:%d"),    \
+                           x, #x, __FILE__, __LINE__);         \
+     abort ();                                                 \
+   }                                                           \
  while (0)
 
-#define FATAL_DEBUG                                                    \
- do                                                                    \
-   {                                                                   \
-     fprintf (stderr,                                                  \
-             _("Internal: Non-debugged code (test-case missing): %s:%d"),\
-             __FILE__, __LINE__);                                      \
-     abort ();                                                         \
-   }                                                                   \
+#define FATAL_DEBUG                                            \
+ do                                                            \
+   {                                                           \
+     opcodes_error_handler (_("internal: non-debugged code "   \
+                             "(test-case missing): %s:%d"),    \
+                           __FILE__, __LINE__);                \
+     abort ();                                                 \
+   }                                                           \
  while (0)
 
 #define ROUND_MODE(n)                                  \
@@ -73,7 +71,7 @@ static bfd_boolean
 initialize_mmix_dis_info (struct disassemble_info *info)
 {
   struct mmix_dis_info *minfop = malloc (sizeof (struct mmix_dis_info));
-  int i;
+  long i;
 
   if (minfop == NULL)
     return FALSE;
@@ -98,7 +96,6 @@ initialize_mmix_dis_info (struct disassemble_info *info)
          long symsize = bfd_get_symtab_upper_bound (abfd);
          asymbol **syms = malloc (symsize);
          long nsyms;
-         long i;
 
          if (syms == NULL)
            {
@@ -125,7 +122,7 @@ initialize_mmix_dis_info (struct disassemble_info *info)
   for (i = 0; i < 256; i++)
     if (minfop->reg_name[i] == NULL)
       {
-       sprintf (minfop->basic_reg_name[i], "$%d", i);
+       sprintf (minfop->basic_reg_name[i], "$%ld", i);
        minfop->reg_name[i] = minfop->basic_reg_name[i];
       }