ubsan: left shift of cannot be represented in type 'int'
[deliverable/binutils-gdb.git] / binutils / bin2c.c
index 4f58a7326b9221b90bb00739fd8e7ed6e9f2c99f..c2539e9598e3a3a88cb8ed323e5cd42b3e3c290c 100644 (file)
@@ -1,11 +1,11 @@
 /* bin2c.c -- dump binary file in hex format
 /* bin2c.c -- dump binary file in hex format
-   Copyright 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007-2019 Free Software Foundation, Inc.
 
    This file is part of GNU Binutils.
 
    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
 
    This file is part of GNU Binutils.
 
    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
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
    02110-1301, USA.  */
 
    Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
    02110-1301, USA.  */
 
-#include "bfd.h"
-#include "bucomm.h"
-
-#if !defined O_BINARY && defined _O_BINARY
-  /* For MSC-compatible compilers.  */
-# define O_BINARY _O_BINARY
-# define O_TEXT _O_TEXT
-#endif
-
-#ifdef __BEOS__
-  /* BeOS 5 has O_BINARY and O_TEXT, but they have no effect.  */
-# undef O_BINARY
-# undef O_TEXT
-#endif
-
-#if O_BINARY
-# ifndef __DJGPP__
-#  define setmode _setmode
-#  define fileno(_fp) _fileno (_fp)
-# endif /* not DJGPP */
-# define SET_BINARY(_f) \
-  do { if (!isatty (_f)) setmode (_f, O_BINARY); } while (0)
-#else
-# define SET_BINARY(f) (void) 0
-# define O_BINARY 0
-# define O_TEXT 0
-#endif /* O_BINARY */
+#include <stdio.h>
+#include <stdlib.h>
+#include "binary-io.h"
 
 int
 main (int argc, char *argv[])
 
 int
 main (int argc, char *argv[])
@@ -52,19 +28,9 @@ main (int argc, char *argv[])
   int c;
   int i;
 
   int c;
   int i;
 
-#if defined (HAVE_SETLOCALE) && defined (HAVE_LC_MESSAGES)
-  setlocale (LC_MESSAGES, "");
-#endif
-#if defined (HAVE_SETLOCALE)
-  setlocale (LC_CTYPE, "");
-#endif
-  bindtextdomain (PACKAGE, LOCALEDIR);
-  textdomain (PACKAGE);
-
   if (argc != 1)
     {
       int ishelp = 0;
   if (argc != 1)
     {
       int ishelp = 0;
-      int isvers = 0;
       FILE *stream;
 
       if (argc == 2 && argv[1][0] == '-')
       FILE *stream;
 
       if (argc == 2 && argv[1][0] == '-')
@@ -73,15 +39,11 @@ main (int argc, char *argv[])
          if (*opt == '-')
            ++opt;
          ishelp = *opt == 'h' || *opt == 'H';
          if (*opt == '-')
            ++opt;
          ishelp = *opt == 'h' || *opt == 'H';
-         isvers = *opt == 'v' || *opt == 'V';
        }
 
        }
 
-      if (isvers)
-       print_version ("bin2c");
-
       stream = ishelp ? stdout : stderr;
       stream = ishelp ? stdout : stderr;
-      fprintf (stream, _("Usage: %s < input_file > output_file\n"), argv[0]);
-      fprintf (stream, _("Prints bytes from stdin in hex format.\n"));
+      fprintf (stream, "Usage: %s < input_file > output_file\n", argv[0]);
+      fprintf (stream, "Prints bytes from stdin in hex format.\n");
       exit (!ishelp);
     }
 
       exit (!ishelp);
     }
 
This page took 0.044517 seconds and 4 git commands to generate.