]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
libebl: consistently use _(Str) instead of gettext(Str)
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 15 Dec 2020 08:00:00 +0000 (08:00 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 16 Dec 2020 10:01:52 +0000 (10:01 +0000)
libeblP.h defines _(Str) to dgettext ("elfutils", Str) instead of
a simple gettext (Str) for a reason: the library might be indirectly
used by clients that called bindtextdomain with a domain different
from "elfutils".

The change was made automatically using the following command:
$ git grep -l '\<gettext *(' libebl |xargs sed -i 's/\<gettext *(/_(/g'

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
12 files changed:
libebl/ChangeLog
libebl/eblbackendname.c
libebl/eblcorenotetypename.c
libebl/ebldynamictagname.c
libebl/eblobjnote.c
libebl/eblobjnotetypename.c
libebl/eblosabiname.c
libebl/eblsectionname.c
libebl/eblsectiontypename.c
libebl/eblsegmenttypename.c
libebl/eblsymbolbindingname.c
libebl/eblsymboltypename.c

index 04e9cd49be490f37a7f4834c1286937a2648199f..e0862ec36d01cdb8f2fce703f7581f9148e05125 100644 (file)
@@ -1,3 +1,17 @@
+2020-12-15  Dmitry V. Levin  <ldv@altlinux.org>
+
+       * eblbackendname.c (ebl_backend_name): Replace gettext(...) with _(...).
+       * eblcorenotetypename.c (ebl_core_note_type_name): Likewise.
+       * ebldynamictagname.c (ebl_dynamic_tag_name): Likewise.
+       * eblobjnote.c (ebl_object_note): Likewise.
+       * eblobjnotetypename.c (ebl_object_note_type_name): Likewise.
+       * eblosabiname.c (ebl_osabi_name): Likewise.
+       * eblsectionname.c (ebl_section_name): Likewise.
+       * eblsectiontypename.c (ebl_section_type_name): Likewise.
+       * eblsegmenttypename.c (ebl_segment_type_name): Likewise.
+       * eblsymbolbindingname.c (ebl_symbol_binding_name): Likewise.
+       * eblsymboltypename.c (ebl_symbol_type_name): Likewise.
+
 2020-10-19  Mark Wielaard  <mark@klomp.org>
 
        * eblopenbackend.c (tilegx_init): Removed.
index a2b2df698325c171be3555d188eda9681e32817a..e52b1e8450d859ad81bb87f0d1cb8400c0005355 100644 (file)
@@ -38,5 +38,5 @@
 const char *
 ebl_backend_name (Ebl *ebl)
 {
-  return ebl != NULL ? ebl->emulation : gettext ("No backend");
+  return ebl != NULL ? ebl->emulation : _("No backend");
 }
index d3a56fa91a6c2220e63d279899d2098ea8d5510b..0e790d062de57b8ed0e31a16ed96767a2dd4d6bf 100644 (file)
@@ -97,7 +97,7 @@ ebl_core_note_type_name (Ebl *ebl, uint32_t type, char *buf, size_t len)
 #undef KNOWNSTYPE
 
          default:
-           snprintf (buf, len, "%s: %" PRIu32, gettext ("<unknown>"), type);
+           snprintf (buf, len, "%s: %" PRIu32, _("<unknown>"), type);
 
            res = buf;
          }
index 5622fc31d14c1e75d0c796b4311a515b4d1a0a35..3f8d8ee4b1d2cbe76c8c6484bb4feccdf927099b 100644 (file)
@@ -100,7 +100,7 @@ ebl_dynamic_tag_name (Ebl *ebl, int64_t tag, char *buf, size_t len)
        res = "FILTER";
       else
        {
-         snprintf (buf, len, gettext ("<unknown>: %#" PRIx64), tag);
+         snprintf (buf, len, _("<unknown>: %#" PRIx64), tag);
 
          res = buf;
 
index 37cbc4998f49f054a71f2305a84f9865a0ed34bd..36efe275fb04a6614873081a62cbe941a0046701 100644 (file)
@@ -55,7 +55,7 @@ ebl_object_note (Ebl *ebl, uint32_t namesz, const char *name, uint32_t type,
        {
          if (type != 3)
            {
-             printf (gettext ("unknown SDT version %u\n"), type);
+             printf (_("unknown SDT version %u\n"), type);
              return;
            }
 
@@ -73,7 +73,7 @@ ebl_object_note (Ebl *ebl, uint32_t namesz, const char *name, uint32_t type,
          if (descsz < addrs_size + 3)
            {
            invalid_sdt:
-             printf (gettext ("invalid SDT probe descriptor\n"));
+             printf (_("invalid SDT probe descriptor\n"));
              return;
            }
 
@@ -123,17 +123,17 @@ ebl_object_note (Ebl *ebl, uint32_t namesz, const char *name, uint32_t type,
              sem = addrs.a64[2];
            }
 
-         printf (gettext ("    PC: "));
+         printf (_("    PC: "));
          printf ("%#" PRIx64 ",", pc);
-         printf (gettext (" Base: "));
+         printf (_(" Base: "));
          printf ("%#" PRIx64 ",", base);
-         printf (gettext (" Semaphore: "));
+         printf (_(" Semaphore: "));
          printf ("%#" PRIx64 "\n", sem);
-         printf (gettext ("    Provider: "));
+         printf (_("    Provider: "));
          printf ("%s,", provider);
-         printf (gettext (" Name: "));
+         printf (_(" Name: "));
          printf ("%s,", pname);
-         printf (gettext (" Args: "));
+         printf (_(" Args: "));
          printf ("'%s'\n", args);
          return;
        }
@@ -297,7 +297,7 @@ ebl_object_note (Ebl *ebl, uint32_t namesz, const char *name, uint32_t type,
        case NT_GNU_BUILD_ID:
          if (strcmp (name, "GNU") == 0 && descsz > 0)
            {
-             printf (gettext ("    Build ID: "));
+             printf (_("    Build ID: "));
              uint_fast32_t i;
              for (i = 0; i < descsz - 1; ++i)
                printf ("%02" PRIx8, (uint8_t) desc[i]);
@@ -308,7 +308,7 @@ ebl_object_note (Ebl *ebl, uint32_t namesz, const char *name, uint32_t type,
        case NT_GNU_GOLD_VERSION:
          if (strcmp (name, "GNU") == 0 && descsz > 0)
            /* A non-null terminated version string.  */
-           printf (gettext ("    Linker version: %.*s\n"),
+           printf (_("    Linker version: %.*s\n"),
                    (int) descsz, desc);
          break;
 
@@ -635,7 +635,7 @@ ebl_object_note (Ebl *ebl, uint32_t namesz, const char *name, uint32_t type,
                      break;
                    }
 
-                 printf (gettext ("    OS: %s, ABI: "), os);
+                 printf (_("    OS: %s, ABI: "), os);
                  for (size_t cnt = 1; cnt < descsz / 4; ++cnt)
                    {
                      if (cnt > 1)
index 6b803cef581959429ec49781999241855ce1b58c..9daddcdafac6b478bef21c9f586f7cecf2c81de2 100644 (file)
@@ -74,7 +74,7 @@ ebl_object_note_type_name (Ebl *ebl, const char *name, uint32_t type,
            return goknowntypes[type];
          else
            {
-             snprintf (buf, len, "%s: %" PRIu32, gettext ("<unknown>"), type);
+             snprintf (buf, len, "%s: %" PRIu32, _("<unknown>"), type);
              return buf;
            }
        }
@@ -106,7 +106,7 @@ ebl_object_note_type_name (Ebl *ebl, const char *name, uint32_t type,
          if (descsz == 0 && type == NT_VERSION)
            return "VERSION";
 
-         snprintf (buf, len, "%s: %" PRIu32, gettext ("<unknown>"), type);
+         snprintf (buf, len, "%s: %" PRIu32, _("<unknown>"), type);
          return buf;
        }
 
@@ -127,7 +127,7 @@ ebl_object_note_type_name (Ebl *ebl, const char *name, uint32_t type,
        res = knowntypes[type];
       else
        {
-         snprintf (buf, len, "%s: %" PRIu32, gettext ("<unknown>"), type);
+         snprintf (buf, len, "%s: %" PRIu32, _("<unknown>"), type);
 
          res = buf;
        }
index b60f2af4254252f12c540b9a8f0531e5ce553973..48b3c05114b2e0eb1d96e8a645f1d92adc84d0a8 100644 (file)
@@ -67,10 +67,10 @@ ebl_osabi_name (Ebl *ebl, int osabi, char *buf, size_t len)
       else if (osabi == ELFOSABI_ARM)
        res = "Arm";
       else if (osabi == ELFOSABI_STANDALONE)
-       res = gettext ("Stand alone");
+       res = _("Stand alone");
       else
        {
-         snprintf (buf, len, "%s: %d", gettext ("<unknown>"), osabi);
+         snprintf (buf, len, "%s: %d", _("<unknown>"), osabi);
 
          res = buf;
        }
index 21c537fff90b66bb8493724e2a6954fd1b842641..825ad2f8fdc74a35f34c3073fdf1fd592b742a80 100644 (file)
@@ -80,7 +80,7 @@ ebl_section_name (Ebl *ebl, int section, int xsection, char *buf, size_t len,
          else if (section >= SHN_LORESERVE && section <= SHN_HIRESERVE)
            snprintf (buf, len, "LORESERVE+%x", section - SHN_LORESERVE);
          else
-           snprintf (buf, len, "%s: %d", gettext ("<unknown>"), section);
+           snprintf (buf, len, "%s: %d", _("<unknown>"), section);
 
          res = buf;
        }
index 5dc1ec6d32fa6228abbbc4e295e0fd33236c802d..2008b95a41d1ba27c33ca78f0e54ff02d239af5c 100644 (file)
@@ -112,7 +112,7 @@ ebl_section_type_name (Ebl *ebl, int section, char *buf, size_t len)
                     && (unsigned int) section <= SHT_HIUSER)
              snprintf (buf, len, "SHT_LOUSER+%x", section - SHT_LOUSER);
            else
-             snprintf (buf, len, "%s: %d", gettext ("<unknown>"), section);
+             snprintf (buf, len, "%s: %d", _("<unknown>"), section);
 
            res = buf;
            break;
index 23a85482b72d03bded16924536dcb1c3b8f24e4e..9977921442156c0368f6cf87609c90c772757a35 100644 (file)
@@ -78,7 +78,7 @@ ebl_segment_type_name (Ebl *ebl, int segment, char *buf, size_t len)
          else if (segment >= PT_LOPROC && segment <= PT_HIPROC)
            snprintf (buf, len, "LOPROC+%d", segment - PT_LOPROC);
          else
-           snprintf (buf, len, "%s: %d", gettext ("<unknown>"), segment);
+           snprintf (buf, len, "%s: %d", _("<unknown>"), segment);
 
          res = buf;
        }
index 75565fe8128ff3c622cf0724d38eeab939807fda..ebd8c2e3cc4f2ed8a4511f2d30efaf88051459ff 100644 (file)
@@ -65,7 +65,7 @@ ebl_symbol_binding_name (Ebl *ebl, int binding, char *buf, size_t len)
          else if (binding >= STB_LOOS && binding <= STB_HIOS)
            snprintf (buf, len, "LOOS+%d", binding - STB_LOOS);
          else
-           snprintf (buf, len, gettext ("<unknown>: %d"), binding);
+           snprintf (buf, len, _("<unknown>: %d"), binding);
 
          res = buf;
        }
index 53b145a8312c6c8ea47e41927112ca025b89f2d4..0ff1722ab9be0b8b00e20503d5b4154dce83356f 100644 (file)
@@ -71,7 +71,7 @@ ebl_symbol_type_name (Ebl *ebl, int symbol, char *buf, size_t len)
          else if (symbol >= STT_LOOS && symbol <= STT_HIOS)
            snprintf (buf, len, "LOOS+%d", symbol - STT_LOOS);
          else
-           snprintf (buf, len, gettext ("<unknown>: %d"), symbol);
+           snprintf (buf, len, _("<unknown>: %d"), symbol);
 
          res = buf;
        }