From patchwork Tue Jun 14 13:11:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Llu=C3=ADs_Vilanova?= X-Patchwork-Id: 635260 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rTVl31sg7z9t1W for ; Tue, 14 Jun 2016 23:25:35 +1000 (AEST) Received: from localhost ([::1]:35250 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCoLV-0006Re-5S for incoming@patchwork.ozlabs.org; Tue, 14 Jun 2016 09:25:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49907) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCo8d-0002IK-E5 for qemu-devel@nongnu.org; Tue, 14 Jun 2016 09:12:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCo8a-00086x-Ad for qemu-devel@nongnu.org; Tue, 14 Jun 2016 09:12:14 -0400 Received: from roura.ac.upc.edu ([147.83.33.10]:42451 helo=roura.ac.upc.es) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCo8U-00086E-FZ; Tue, 14 Jun 2016 09:12:06 -0400 Received: from gw-3.ac.upc.es (gw-3.ac.upc.es [147.83.30.9]) by roura.ac.upc.es (8.13.8/8.13.8) with ESMTP id u5EDB1RO008016; Tue, 14 Jun 2016 15:11:01 +0200 Received: from localhost (unknown [84.88.51.85]) by gw-3.ac.upc.es (Postfix) with ESMTPSA id 7BD51213; Tue, 14 Jun 2016 15:11:01 +0200 (CEST) From: =?utf-8?b?TGx1w61z?= Vilanova To: qemu-devel@nongnu.org Date: Tue, 14 Jun 2016 15:11:01 +0200 Message-Id: <146590986119.16561.848653586742206135.stgit@fimbulvetr.bsc.es> X-Mailer: git-send-email 2.8.1 In-Reply-To: <146590985033.16561.16324808287190305042.stgit@fimbulvetr.bsc.es> References: <146590985033.16561.16324808287190305042.stgit@fimbulvetr.bsc.es> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-MIME-Autoconverted: from 8bit to quoted-printable by roura.ac.upc.es id u5EDB1RO008016 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 147.83.33.10 Subject: [Qemu-devel] [PATCH v4 2/6] disas: Remove unused macro '_' X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , "open list:ARM target" , Eduardo Habkost , "open list:PowerPC" , Mark Cave-Ayland , Alexander Graf , Blue Swirl , Leon Alrae , "Vassili Karpov \(malc\)" , Stefan Hajnoczi , Paolo Bonzini , David Gibson , Aurelien Jarno , Richard Henderson Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Eliminates a future compilation error when UI code includes the tracing headers (indirectly pulling "disas/bfd.h" through "qom/cpu.h") and GLib's i18n '_' macro. Signed-off-by: LluĂ­s Vilanova Reviewed-by: Stefan Hajnoczi --- disas/alpha.c | 6 +++--- disas/arm.c | 2 +- disas/i386.c | 2 +- disas/m68k.c | 4 ++-- disas/mips.c | 50 +++++++++++++++++++++++++------------------------- disas/ppc.c | 22 +++++++++++----------- disas/sparc.c | 6 +++--- include/disas/bfd.h | 1 - 8 files changed, 46 insertions(+), 47 deletions(-) diff --git a/disas/alpha.c b/disas/alpha.c index 44d00a3..b7b0ae0 100644 --- a/disas/alpha.c +++ b/disas/alpha.c @@ -521,7 +521,7 @@ static unsigned insert_bdisp(unsigned insn, int value, const char **errmsg) { if (errmsg != (const char **)NULL && (value & 3)) - *errmsg = _("branch operand unaligned"); + *errmsg = "branch operand unaligned"; return insn | ((value / 4) & 0x1FFFFF); } @@ -539,7 +539,7 @@ static unsigned insert_jhint(unsigned insn, int value, const char **errmsg) { if (errmsg != (const char **)NULL && (value & 3)) - *errmsg = _("jump hint unaligned"); + *errmsg = "jump hint unaligned"; return insn | ((value / 4) & 0x3FFF); } @@ -556,7 +556,7 @@ static unsigned insert_ev6hwjhint(unsigned insn, int value, const char **errmsg) { if (errmsg != (const char **)NULL && (value & 3)) - *errmsg = _("jump hint unaligned"); + *errmsg = "jump hint unaligned"; return insn | ((value / 4) & 0x1FFF); } diff --git a/disas/arm.c b/disas/arm.c index 70da529..32f8ca9 100644 --- a/disas/arm.c +++ b/disas/arm.c @@ -1817,7 +1817,7 @@ print_insn_coprocessor (bfd_vma pc, struct disassemble_info *info, long given, func (stream, "e"); break; default: - func (stream, _("")); + func (stream, ""); break; } break; diff --git a/disas/i386.c b/disas/i386.c index c0e717a..57145d0 100644 --- a/disas/i386.c +++ b/disas/i386.c @@ -3406,7 +3406,7 @@ static const struct dis386 three_byte_table[][256] = { } }; -#define INTERNAL_DISASSEMBLER_ERROR _("") +#define INTERNAL_DISASSEMBLER_ERROR "" static void ckprefix (void) diff --git a/disas/m68k.c b/disas/m68k.c index 8f74ae1..8e7c3f7 100644 --- a/disas/m68k.c +++ b/disas/m68k.c @@ -1676,7 +1676,7 @@ print_insn_arg (const char *d, (*info->fprintf_func) (info->stream, "%%sfc"); else /* xgettext:c-format */ - (*info->fprintf_func) (info->stream, _(""), fc); + (*info->fprintf_func) (info->stream, "", fc); } break; @@ -1827,7 +1827,7 @@ match_insn_m68k (bfd_vma memaddr, { info->fprintf_func (info->stream, /* xgettext:c-format */ - _("\n"), + "\n", best->name, best->args); info->fprintf_func = save_printer; info->print_address_func = save_print_address; diff --git a/disas/mips.c b/disas/mips.c index 249931b..97f661a 100644 --- a/disas/mips.c +++ b/disas/mips.c @@ -4257,7 +4257,7 @@ print_insn_args (const char *d, case '\0': /* xgettext:c-format */ (*info->fprintf_func) (info->stream, - _("# internal error, incomplete extension sequence (+)")); + "# internal error, incomplete extension sequence (+)"); return; case 'A': @@ -4515,7 +4515,7 @@ print_insn_args (const char *d, default: /* xgettext:c-format */ (*info->fprintf_func) (info->stream, - _("# internal error, undefined extension sequence (+%c)"), + "# internal error, undefined extension sequence (+%c)", *d); return; } @@ -4875,7 +4875,7 @@ print_insn_args (const char *d, default: /* xgettext:c-format */ (*info->fprintf_func) (info->stream, - _("# internal error, undefined modifier(%c)"), + "# internal error, undefined modifier(%c)", *d); return; } @@ -5739,7 +5739,7 @@ print_mips16_insn_arg (char type, /* xgettext:c-format */ (*info->fprintf_func) (info->stream, - _("# internal disassembler error, unrecognised modifier (%c)"), + "# internal disassembler error, unrecognised modifier (%c)", type); abort (); } @@ -5750,51 +5750,51 @@ print_mips_disassembler_options (FILE *stream) { unsigned int i; - fprintf (stream, _("\n\ + fprintf (stream, "\n\ The following MIPS specific disassembler options are supported for use\n\ -with the -M switch (multiple options should be separated by commas):\n")); +with the -M switch (multiple options should be separated by commas):\n"); - fprintf (stream, _("\n\ + fprintf (stream, "\n\ gpr-names=ABI Print GPR names according to specified ABI.\n\ - Default: based on binary being disassembled.\n")); + Default: based on binary being disassembled.\n"); - fprintf (stream, _("\n\ + fprintf (stream, "\n\ fpr-names=ABI Print FPR names according to specified ABI.\n\ - Default: numeric.\n")); + Default: numeric.\n"); - fprintf (stream, _("\n\ + fprintf (stream, "\n\ cp0-names=ARCH Print CP0 register names according to\n\ specified architecture.\n\ - Default: based on binary being disassembled.\n")); + Default: based on binary being disassembled.\n"); - fprintf (stream, _("\n\ + fprintf (stream, "\n\ hwr-names=ARCH Print HWR names according to specified\n\ architecture.\n\ - Default: based on binary being disassembled.\n")); + Default: based on binary being disassembled.\n"); - fprintf (stream, _("\n\ + fprintf (stream, "\n\ reg-names=ABI Print GPR and FPR names according to\n\ - specified ABI.\n")); + specified ABI.\n"); - fprintf (stream, _("\n\ + fprintf (stream, "\n\ reg-names=ARCH Print CP0 register and HWR names according to\n\ - specified architecture.\n")); + specified architecture.\n"); - fprintf (stream, _("\n\ + fprintf (stream, "\n\ For the options above, the following values are supported for \"ABI\":\n\ - ")); + "); for (i = 0; i < ARRAY_SIZE (mips_abi_choices); i++) fprintf (stream, " %s", mips_abi_choices[i].name); - fprintf (stream, _("\n")); + fprintf (stream, "\n"); - fprintf (stream, _("\n\ + fprintf (stream, "\n\ For the options above, The following values are supported for \"ARCH\":\n\ - ")); + "); for (i = 0; i < ARRAY_SIZE (mips_arch_choices); i++) if (*mips_arch_choices[i].name != '\0') fprintf (stream, " %s", mips_arch_choices[i].name); - fprintf (stream, _("\n")); + fprintf (stream, "\n"); - fprintf (stream, _("\n")); + fprintf (stream, "\n"); } #endif diff --git a/disas/ppc.c b/disas/ppc.c index 478332b..052cebe 100644 --- a/disas/ppc.c +++ b/disas/ppc.c @@ -1120,7 +1120,7 @@ insert_bo (unsigned long insn, const char **errmsg) { if (!valid_bo (value, dialect, 0)) - *errmsg = _("invalid conditional option"); + *errmsg = "invalid conditional option"; return insn | ((value & 0x1f) << 21); } @@ -1148,9 +1148,9 @@ insert_boe (unsigned long insn, const char **errmsg) { if (!valid_bo (value, dialect, 0)) - *errmsg = _("invalid conditional option"); + *errmsg = "invalid conditional option"; else if ((value & 1) != 0) - *errmsg = _("attempt to set y bit when using + or - modifier"); + *errmsg = "attempt to set y bit when using + or - modifier"; return insn | ((value & 0x1f) << 21); } @@ -1182,7 +1182,7 @@ insert_fxm (unsigned long insn, { if (value == 0 || (value & -value) != value) { - *errmsg = _("invalid mask field"); + *errmsg = "invalid mask field"; value = 0; } } @@ -1208,7 +1208,7 @@ insert_fxm (unsigned long insn, /* Any other value on mfcr is an error. */ else if ((insn & (0x3ff << 1)) == 19 << 1) { - *errmsg = _("ignoring invalid mfcr mask"); + *errmsg = "ignoring invalid mfcr mask"; value = 0; } @@ -1258,7 +1258,7 @@ insert_mbe (unsigned long insn, if (uval == 0) { - *errmsg = _("illegal bitmask"); + *errmsg = "illegal bitmask"; return insn; } @@ -1293,7 +1293,7 @@ insert_mbe (unsigned long insn, me = 32; if (count != 2 && (count != 0 || ! last)) - *errmsg = _("illegal bitmask"); + *errmsg = "illegal bitmask"; return insn | (mb << 6) | ((me - 1) << 1); } @@ -1413,7 +1413,7 @@ insert_ram (unsigned long insn, const char **errmsg) { if ((unsigned long) value >= ((insn >> 21) & 0x1f)) - *errmsg = _("index register in load range"); + *errmsg = "index register in load range"; return insn | ((value & 0x1f) << 16); } @@ -1429,7 +1429,7 @@ insert_raq (unsigned long insn, long rtvalue = (insn & RT_MASK) >> 21; if (value == rtvalue) - *errmsg = _("source and target register operands must be different"); + *errmsg = "source and target register operands must be different"; return insn | ((value & 0x1f) << 16); } @@ -1444,7 +1444,7 @@ insert_ras (unsigned long insn, const char **errmsg) { if (value == 0) - *errmsg = _("invalid register operand when updating"); + *errmsg = "invalid register operand when updating"; return insn | ((value & 0x1f) << 16); } @@ -1526,7 +1526,7 @@ insert_sprg (unsigned long insn, if (value > 7 || (value > 3 && (dialect & (PPC_OPCODE_BOOKE | PPC_OPCODE_403)) == 0)) - *errmsg = _("invalid sprg number"); + *errmsg = "invalid sprg number"; /* If this is mfsprg4..7 then use spr 260..263 which can be read in user mode. Anything else must use spr 272..279. */ diff --git a/disas/sparc.c b/disas/sparc.c index 64bba8d..f120f4e 100644 --- a/disas/sparc.c +++ b/disas/sparc.c @@ -2494,7 +2494,7 @@ compare_opcodes (const void * a, const void * b) fprintf (stderr, /* xgettext:c-format */ - _("Internal error: bad sparc-opcode.h: \"%s\", %#.8lx, %#.8lx\n"), + "Internal error: bad sparc-opcode.h: \"%s\", %#.8lx, %#.8lx\n", op0->name, match0, lose0); op0->lose &= ~op0->match; lose0 = op0->lose; @@ -2505,7 +2505,7 @@ compare_opcodes (const void * a, const void * b) fprintf (stderr, /* xgettext:c-format */ - _("Internal error: bad sparc-opcode.h: \"%s\", %#.8lx, %#.8lx\n"), + "Internal error: bad sparc-opcode.h: \"%s\", %#.8lx, %#.8lx\n", op1->name, match1, lose1); op1->lose &= ~op1->match; lose1 = op1->lose; @@ -2555,7 +2555,7 @@ compare_opcodes (const void * a, const void * b) else fprintf (stderr, /* xgettext:c-format */ - _("Internal error: bad sparc-opcode.h: \"%s\" == \"%s\"\n"), + "Internal error: bad sparc-opcode.h: \"%s\" == \"%s\"\n", op0->name, op1->name); } diff --git a/include/disas/bfd.h b/include/disas/bfd.h index a112e9c..a761d5b 100644 --- a/include/disas/bfd.h +++ b/include/disas/bfd.h @@ -477,7 +477,6 @@ int generic_symbol_at_address(bfd_vma, struct disassemble_info *); (INFO).disassembler_options = NULL, \ (INFO).insn_info_valid = 0 -#define _(x) x #define ATTRIBUTE_UNUSED __attribute__((unused)) /* from libbfd */