public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@altlinux.org>
To: elfutils-devel@sourceware.org
Subject: [PATCH 3/4] libcpu: consistently use _(Str) instead of gettext(Str)
Date: Wed, 16 Dec 2020 12:54:26 +0300	[thread overview]
Message-ID: <20201216095426.GC26456@altlinux.org> (raw)
In-Reply-To: <20201216014759.GA21292@altlinux.org>

eu-config.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 *(' libcpu |xargs sed -i 's/\<gettext *(/_(/g'

Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---
 libcpu/ChangeLog    | 5 +++++
 libcpu/i386_lex.l   | 4 ++--
 libcpu/i386_parse.y | 4 ++--
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/libcpu/ChangeLog b/libcpu/ChangeLog
index 000105bf..781c8f41 100644
--- a/libcpu/ChangeLog
+++ b/libcpu/ChangeLog
@@ -1,3 +1,8 @@
+2020-12-16  Dmitry V. Levin  <ldv@altlinux.org>
+
+	* i386_lex.l (invalid_char): Replace gettext(...) with _(...).
+	* i386_parse.y (yyerror): Likewise.
+
 2020-12-12  Dmitry V. Levin  <ldv@altlinux.org>
 
 	* bpf_disasm.c (bswap_bpf_insn): Fix spelling typo in comment.
diff --git a/libcpu/i386_lex.l b/libcpu/i386_lex.l
index a4705aa9..b6ec0f87 100644
--- a/libcpu/i386_lex.l
+++ b/libcpu/i386_lex.l
@@ -119,8 +119,8 @@ static void
 invalid_char (int ch)
 {
   error (0, 0, (isascii (ch)
-		? gettext ("invalid character '%c' at line %d; ignored")
-		: gettext ("invalid character '\\%o' at line %d; ignored")),
+		? _("invalid character '%c' at line %d; ignored")
+		: _("invalid character '\\%o' at line %d; ignored")),
 	 ch, yylineno);
 }
 
diff --git a/libcpu/i386_parse.y b/libcpu/i386_parse.y
index 90c7bd93..9a92c2e0 100644
--- a/libcpu/i386_parse.y
+++ b/libcpu/i386_parse.y
@@ -551,8 +551,8 @@ argcomp:	  kBITFIELD
 static void
 yyerror (const char *s)
 {
-  error (0, 0, gettext ("while reading i386 CPU description: %s at line %d"),
-         gettext (s), i386_lineno);
+  error (0, 0, _("while reading i386 CPU description: %s at line %d"),
+         _(s), i386_lineno);
 }
 
 
-- 
ldv

  parent reply	other threads:[~2020-12-16  9:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-16  1:48 [PATCH] libebl: " Dmitry V. Levin
2020-12-16  9:54 ` [PATCH 1/4] Consistently define _(Str) using dgettext ("elfutils", Str) Dmitry V. Levin
2020-12-16  9:54 ` [PATCH 2/4] lib: consistently use _(Str) instead of gettext(Str) Dmitry V. Levin
2020-12-16  9:54 ` Dmitry V. Levin [this message]
2020-12-16  9:54 ` [PATCH 4/4] src: " Dmitry V. Levin
2020-12-16 14:09 ` [PATCH] libebl: " Mark Wielaard

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=20201216095426.GC26456@altlinux.org \
    --to=ldv@altlinux.org \
    --cc=elfutils-devel@sourceware.org \
    /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).