public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Binutils <binutils@sourceware.org>
Cc: "H.J. Lu" <hjl.tools@gmail.com>
Subject: [PATCH 1/2] x86: remove internationalization from i386-gen.c
Date: Fri, 20 Jan 2023 10:30:48 +0100	[thread overview]
Message-ID: <98a5c1d5-00c9-75b3-db8c-019e056d720c@suse.com> (raw)
In-Reply-To: <693ee234-169d-a576-809a-07bdc2be1ba7@suse.com>

This is a build time helper utility, which doesn't require translation.
---
It's entirely unclear to me whether such an adjustment is expected to be
immediately accompanied by an update of po/opcodes.pot.

--- a/opcodes/i386-gen.c
+++ b/opcodes/i386-gen.c
@@ -28,9 +28,6 @@
 
 #include "i386-opc.h"
 
-#include <libintl.h>
-#define _(String) gettext (String)
-
 /* Build-time checks are preferrable over runtime ones.  Use this construct
    in preference where possible.  */
 #define static_assert(e) ((void)sizeof (struct { int _:1 - 2 * !(e); }))
@@ -557,7 +554,7 @@ fail (const char *message, ...)
   va_list args;
 
   va_start (args, message);
-  fprintf (stderr, _("%s: error: "), program_name);
+  fprintf (stderr, "%s: error: ", program_name);
   vfprintf (stderr, message, args);
   va_end (args);
   xexit (1);
@@ -683,9 +680,9 @@ set_bitfield (char *f, bitfield *array,
     }
 
   if (lineno != -1)
-    fail (_("%s: %d: unknown bitfield: %s\n"), filename, lineno, f);
+    fail ("%s: %d: unknown bitfield: %s\n", filename, lineno, f);
   else
-    fail (_("unknown bitfield: %s\n"), f);
+    fail ("unknown bitfield: %s\n", f);
 }
 
 static void
@@ -752,7 +749,7 @@ add_isa_dependencies (bitfield *flags, c
       }
 
   if (!is_isa)
-    fail (_("unknown bitfield: %s\n"), f);
+    fail ("unknown bitfield: %s\n", f);
 }
 
 static void
@@ -817,7 +814,7 @@ process_i386_cpu_flag (FILE *table, char
 	  last -= 1;
 	  next = flag + 2;
 	  if (*last != ')')
-	    fail (_("%s: %d: missing `)' in bitfield: %s\n"), filename,
+	    fail ("%s: %d: missing `)' in bitfield: %s\n", filename,
 		  lineno, flag);
 	  *last = '\0';
 	}
@@ -917,7 +914,7 @@ get_element_size (char **opnd, int linen
   while (full != NULL && strstr(full, "BaseIndex") == NULL)
     full = *++opnd;
   if (full == NULL)
-    fail (_("%s: %d: no memory operand\n"), filename, lineno);
+    fail ("%s: %d: no memory operand\n", filename, lineno);
 
   op = xstrdup (full);
   last = op + strlen (op);
@@ -953,7 +950,7 @@ get_element_size (char **opnd, int linen
   free (op);
 
   if (elem_size == INT_MAX)
-    fail (_("%s: %d: unknown element size: %s\n"), filename, lineno, full);
+    fail ("%s: %d: unknown element size: %s\n", filename, lineno, full);
 
   return elem_size;
 }
@@ -1010,11 +1007,11 @@ process_i386_opcode_modifier (FILE *tabl
 	  if (!modifiers[OpcodeSpace].value)
 	    modifiers[OpcodeSpace].value = space;
 	  else if (modifiers[OpcodeSpace].value != space)
-	    fail (_("%s:%d: Conflicting opcode space specifications\n"),
+	    fail ("%s:%d: Conflicting opcode space specifications\n",
 		  filename, lineno);
 	  else
 	    fprintf (stderr,
-		     _("%s:%d: Warning: redundant opcode space specification\n"),
+		     "%s:%d: Warning: redundant opcode space specification\n",
 		     filename, lineno);
 	}
 
@@ -1023,11 +1020,11 @@ process_i386_opcode_modifier (FILE *tabl
 	  if (!modifiers[OpcodePrefix].value)
 	    modifiers[OpcodePrefix].value = prefix;
 	  else if (modifiers[OpcodePrefix].value != prefix)
-	    fail (_("%s:%d: Conflicting prefix specifications\n"),
+	    fail ("%s:%d: Conflicting prefix specifications\n",
 		  filename, lineno);
 	  else
 	    fprintf (stderr,
-		     _("%s:%d: Warning: redundant prefix specification\n"),
+		     "%s:%d: Warning: redundant prefix specification\n",
 		     filename, lineno);
 	}
 
@@ -1250,13 +1247,13 @@ output_i386_opcode (FILE *table, const c
 	}
 
       if (space != SPACE_0F && --length == 1)
-	fail (_("%s:%d: %s: unrecognized opcode encoding space\n"),
+	fail ("%s:%d: %s: unrecognized opcode encoding space\n",
 	      filename, lineno, name);
       opcode &= (1ULL << (8 * --length)) - 1;
     }
 
   if (length > 2)
-    fail (_("%s:%d: %s: residual opcode (0x%0*llx) too large\n"),
+    fail ("%s:%d: %s: residual opcode (0x%0*llx) too large\n",
 	  filename, lineno, name, 2 * length, opcode);
 
   ident = mkident (name);
@@ -1648,7 +1645,7 @@ process_i386_opcodes (FILE *table)
 	  if (!j || buf[j - 1] != '+')
 	    break;
 	  if (j >= sizeof (buf) - 1)
-	    fail (_("%s: %d: (continued) line too long\n"), filename, lineno);
+	    fail ("%s: %d: (continued) line too long\n", filename, lineno);
 
 	  if (fgets (buf + j - 1, sizeof (buf) - j + 1, fp) == NULL)
 	    {
@@ -1746,7 +1743,7 @@ process_i386_opcodes (FILE *table)
 
   fp = fopen ("i386-mnem.h", "w");
   if (fp == NULL)
-    fail (_("can't create i386-mnem.h, errno = %s\n"),
+    fail ("can't create i386-mnem.h, errno = %s\n",
 	  xstrerror (errno));
 
   process_copyright (fp);
@@ -1800,7 +1797,7 @@ process_i386_registers (FILE *table)
   filename = "i386-reg.tbl";
   fp = fopen (filename, "r");
   if (fp == NULL)
-    fail (_("can't find i386-reg.tbl for reading, errno = %s\n"),
+    fail ("can't find i386-reg.tbl for reading, errno = %s\n",
 	  xstrerror (errno));
 
   fprintf (table, "\n/* i386 register table.  */\n\n");
@@ -1877,7 +1874,7 @@ process_i386_initializers (void)
   FILE *fp = fopen ("i386-init.h", "w");
 
   if (fp == NULL)
-    fail (_("can't create i386-init.h, errno = %s\n"),
+    fail ("can't create i386-init.h, errno = %s\n",
 	  xstrerror (errno));
 
   process_copyright (fp);
@@ -1992,7 +1989,7 @@ main (int argc, char **argv)
 
   if (srcdir != NULL)
     if (chdir (srcdir) != 0)
-      fail (_("unable to change directory to \"%s\", errno = %s\n"),
+      fail ("unable to change directory to \"%s\", errno = %s\n",
 	    srcdir, xstrerror (errno));
 
   /* cpu_flags isn't sorted by position.  */
@@ -2006,16 +2003,16 @@ main (int argc, char **argv)
   static_assert (ARRAY_SIZE (cpu_flags) == CpuMax + 2);
 
   if ((cpumax - 1) != CpuMax)
-    fail (_("CpuMax != %d!\n"), cpumax);
+    fail ("CpuMax != %d!\n", cpumax);
 #else
   static_assert (ARRAY_SIZE (cpu_flags) == CpuMax + 1);
 
   if (cpumax != CpuMax)
-    fail (_("CpuMax != %d!\n"), cpumax);
+    fail ("CpuMax != %d!\n", cpumax);
 
   c = CpuNumOfBits - CpuMax - 1;
   if (c)
-    fail (_("%d unused bits in i386_cpu_flags.\n"), c);
+    fail ("%d unused bits in i386_cpu_flags.\n", c);
 #endif
 
   static_assert (ARRAY_SIZE (opcode_modifiers) == Opcode_Modifier_Num);
@@ -2030,7 +2027,7 @@ main (int argc, char **argv)
 
   c = OTNumOfBits - OTNum;
   if (c)
-    fail (_("%d unused bits in i386_operand_type.\n"), c);
+    fail ("%d unused bits in i386_operand_type.\n", c);
 #endif
 
   qsort (cpu_flags, ARRAY_SIZE (cpu_flags), sizeof (cpu_flags [0]),
@@ -2044,7 +2041,7 @@ main (int argc, char **argv)
 
   table = fopen ("i386-tbl.h", "w");
   if (table == NULL)
-    fail (_("can't create i386-tbl.h, errno = %s\n"),
+    fail ("can't create i386-tbl.h, errno = %s\n",
 	  xstrerror (errno));
 
   process_copyright (table);


  reply	other threads:[~2023-01-20  9:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-20  9:29 [PATCH 0/2] opcodes: no internationalization needed for build helper tools Jan Beulich
2023-01-20  9:30 ` Jan Beulich [this message]
2023-01-20  9:31 ` [PATCH 2/2] opcodes: suppress internationalization on " Jan Beulich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=98a5c1d5-00c9-75b3-db8c-019e056d720c@suse.com \
    --to=jbeulich@suse.com \
    --cc=binutils@sourceware.org \
    --cc=hjl.tools@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).