From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from vmicros1.altlinux.org (vmicros1.altlinux.org [194.107.17.57]) by sourceware.org (Postfix) with ESMTP id C6A5F3857801 for ; Wed, 16 Dec 2020 01:48:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org C6A5F3857801 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=altlinux.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ldv@altlinux.org Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 3FC7A72C8B5 for ; Wed, 16 Dec 2020 04:48:00 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 1DE677CC819; Wed, 16 Dec 2020 04:48:00 +0300 (MSK) Date: Wed, 16 Dec 2020 04:48:00 +0300 From: "Dmitry V. Levin" To: elfutils-devel@sourceware.org Subject: [PATCH] libebl: consistently use _(Str) instead of gettext(Str) Message-ID: <20201216014759.GA21292@altlinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_STOCKGEN, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2020 01:48:03 -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 '\ --- libebl/ChangeLog | 14 ++++++++++++++ libebl/eblbackendname.c | 2 +- libebl/eblcorenotetypename.c | 2 +- libebl/ebldynamictagname.c | 2 +- libebl/eblobjnote.c | 22 +++++++++++----------- libebl/eblobjnotetypename.c | 6 +++--- libebl/eblosabiname.c | 4 ++-- libebl/eblsectionname.c | 2 +- libebl/eblsectiontypename.c | 2 +- libebl/eblsegmenttypename.c | 2 +- libebl/eblsymbolbindingname.c | 2 +- libebl/eblsymboltypename.c | 2 +- 12 files changed, 38 insertions(+), 24 deletions(-) diff --git a/libebl/ChangeLog b/libebl/ChangeLog index 04e9cd49..e0862ec3 100644 --- a/libebl/ChangeLog +++ b/libebl/ChangeLog @@ -1,3 +1,17 @@ +2020-12-15 Dmitry V. Levin + + * 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 * eblopenbackend.c (tilegx_init): Removed. diff --git a/libebl/eblbackendname.c b/libebl/eblbackendname.c index a2b2df69..e52b1e84 100644 --- a/libebl/eblbackendname.c +++ b/libebl/eblbackendname.c @@ -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"); } diff --git a/libebl/eblcorenotetypename.c b/libebl/eblcorenotetypename.c index d3a56fa9..0e790d06 100644 --- a/libebl/eblcorenotetypename.c +++ b/libebl/eblcorenotetypename.c @@ -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 (""), type); + snprintf (buf, len, "%s: %" PRIu32, _(""), type); res = buf; } diff --git a/libebl/ebldynamictagname.c b/libebl/ebldynamictagname.c index 5622fc31..3f8d8ee4 100644 --- a/libebl/ebldynamictagname.c +++ b/libebl/ebldynamictagname.c @@ -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 (": %#" PRIx64), tag); + snprintf (buf, len, _(": %#" PRIx64), tag); res = buf; diff --git a/libebl/eblobjnote.c b/libebl/eblobjnote.c index 37cbc499..36efe275 100644 --- a/libebl/eblobjnote.c +++ b/libebl/eblobjnote.c @@ -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) diff --git a/libebl/eblobjnotetypename.c b/libebl/eblobjnotetypename.c index 6b803cef..9daddcda 100644 --- a/libebl/eblobjnotetypename.c +++ b/libebl/eblobjnotetypename.c @@ -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 (""), type); + snprintf (buf, len, "%s: %" PRIu32, _(""), 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 (""), type); + snprintf (buf, len, "%s: %" PRIu32, _(""), 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 (""), type); + snprintf (buf, len, "%s: %" PRIu32, _(""), type); res = buf; } diff --git a/libebl/eblosabiname.c b/libebl/eblosabiname.c index b60f2af4..48b3c051 100644 --- a/libebl/eblosabiname.c +++ b/libebl/eblosabiname.c @@ -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 (""), osabi); + snprintf (buf, len, "%s: %d", _(""), osabi); res = buf; } diff --git a/libebl/eblsectionname.c b/libebl/eblsectionname.c index 21c537ff..825ad2f8 100644 --- a/libebl/eblsectionname.c +++ b/libebl/eblsectionname.c @@ -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 (""), section); + snprintf (buf, len, "%s: %d", _(""), section); res = buf; } diff --git a/libebl/eblsectiontypename.c b/libebl/eblsectiontypename.c index 5dc1ec6d..2008b95a 100644 --- a/libebl/eblsectiontypename.c +++ b/libebl/eblsectiontypename.c @@ -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 (""), section); + snprintf (buf, len, "%s: %d", _(""), section); res = buf; break; diff --git a/libebl/eblsegmenttypename.c b/libebl/eblsegmenttypename.c index 23a85482..99779214 100644 --- a/libebl/eblsegmenttypename.c +++ b/libebl/eblsegmenttypename.c @@ -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 (""), segment); + snprintf (buf, len, "%s: %d", _(""), segment); res = buf; } diff --git a/libebl/eblsymbolbindingname.c b/libebl/eblsymbolbindingname.c index 75565fe8..ebd8c2e3 100644 --- a/libebl/eblsymbolbindingname.c +++ b/libebl/eblsymbolbindingname.c @@ -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 (": %d"), binding); + snprintf (buf, len, _(": %d"), binding); res = buf; } diff --git a/libebl/eblsymboltypename.c b/libebl/eblsymboltypename.c index 53b145a8..0ff1722a 100644 --- a/libebl/eblsymboltypename.c +++ b/libebl/eblsymboltypename.c @@ -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 (": %d"), symbol); + snprintf (buf, len, _(": %d"), symbol); res = buf; } -- ldv