From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18052 invoked by alias); 23 Oct 2008 08:10:07 -0000 Received: (qmail 18043 invoked by uid 22791); 23 Oct 2008 08:10:06 -0000 X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 23 Oct 2008 08:09:31 +0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m9N89Rvo015420; Thu, 23 Oct 2008 04:09:28 -0400 Received: from pobox.stuttgart.redhat.com (pobox.stuttgart.redhat.com [172.16.2.10]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m9N89QOA002470; Thu, 23 Oct 2008 04:09:27 -0400 Received: from host0.dyn.jankratochvil.net (sebastian-int.corp.redhat.com [172.16.52.221]) by pobox.stuttgart.redhat.com (8.13.1/8.13.1) with ESMTP id m9N89OdG030187; Thu, 23 Oct 2008 04:09:26 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.3/8.14.2) with ESMTP id m9N89OhC031810; Thu, 23 Oct 2008 10:09:24 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.3/8.14.2/Submit) id m9N89Nn9031804; Thu, 23 Oct 2008 10:09:23 +0200 Date: Thu, 23 Oct 2008 08:10:00 -0000 From: Jan Kratochvil To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: [RFA/Ada] Implement Ada tasking support (take 2) Message-ID: <20081023080923.GA31562@host0.dyn.jankratochvil.net> References: <20080924174850.GC3607@adacore.com> <20081022195840.GD3638@adacore.com> <20081022223621.GA25013@host0.dyn.jankratochvil.net> <20081023004905.GJ3638@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="GvXjxJ+pjyke8COw" Content-Disposition: inline In-Reply-To: <20081023004905.GJ3638@adacore.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-10/txt/msg00568.txt.bz2 --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 633 On Thu, 23 Oct 2008 02:49:05 +0200, Joel Brobecker wrote: > > ada-tasks.c:57: error: initializer element is not constant > > ada-tasks.c:57: error: (near initialization for ?$B!Ftask_states[0]?$B!G) > > ... > > Humpf. I didn't get any warning with my compiler. Sorry about that. Interesting, the default in intl/config.intl is --enable-nls which should fail this way. > > (There should be N_() with runtime _(var) and not static _().) > > Do you mean like this? Yes but we need to also later explicitely translate the strings as N_() is a NOP just to get the messages extracted to the catalog. OK to commit it? Regards, Jan --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename="gdb-ada-tasks.patch" Content-length: 2950 2008-10-23 Jan Kratochvil Joel Brobecker * ada-tasks.c (task_states, long_task_states): Use constant N_() initializer. Define the strings as const. (short_task_info, info_task): Translate the strings above. --- gdb/ada-tasks.c 22 Oct 2008 19:45:05 -0000 1.12 +++ gdb/ada-tasks.c 23 Oct 2008 08:02:15 -0000 @@ -53,42 +53,42 @@ enum task_states }; /* A short description corresponding to each possible task state. */ -static char *task_states[] = { - _("Unactivated"), - _("Runnable"), - _("Terminated"), - _("Child Activation Wait"), - _("Accept Statement"), - _("Waiting on entry call"), - _("Async Select Wait"), - _("Delay Sleep"), - _("Child Termination Wait"), - _("Wait Child in Term Alt"), +static const char *task_states[] = { + N_("Unactivated"), + N_("Runnable"), + N_("Terminated"), + N_("Child Activation Wait"), + N_("Accept Statement"), + N_("Waiting on entry call"), + N_("Async Select Wait"), + N_("Delay Sleep"), + N_("Child Termination Wait"), + N_("Wait Child in Term Alt"), "", "", "", "", - _("Asynchronous Hold"), + N_("Asynchronous Hold"), "" }; /* A longer description corresponding to each possible task state. */ -static char *long_task_states[] = { - _("Unactivated"), - _("Runnable"), - _("Terminated"), - _("Waiting for child activation"), - _("Blocked in accept statement"), - _("Waiting on entry call"), - _("Asynchronous Selective Wait"), - _("Delay Sleep"), - _("Waiting for children termination"), - _("Waiting for children in terminate alternative"), +static const char *long_task_states[] = { + N_("Unactivated"), + N_("Runnable"), + N_("Terminated"), + N_("Waiting for child activation"), + N_("Blocked in accept statement"), + N_("Waiting on entry call"), + N_("Asynchronous Selective Wait"), + N_("Delay Sleep"), + N_("Waiting for children termination"), + N_("Waiting for children in terminate alternative"), "", "", "", "", - _("Asynchronous Hold"), + N_("Asynchronous Hold"), "" }; @@ -744,9 +744,9 @@ short_task_info (int taskno) get_task_number_from_id (task_info->called_task)); else if (task_info->state == Runnable && active_task_p) /* Replace "Runnable" by "Running" since this is the active task. */ - printf_filtered (" %-22s", "Running"); + printf_filtered (" %-22s", _("Running")); else - printf_filtered (" %-22s", task_states[task_info->state]); + printf_filtered (" %-22s", _(task_states[task_info->state])); /* Finally, print the task name. */ if (task_info->name[0] != '\0') @@ -833,7 +833,7 @@ info_task (char *taskno_str, int from_tt target_taskno); } else - printf_filtered ("State: %s", long_task_states[task_info->state]); + printf_filtered (_("State: %s"), _(long_task_states[task_info->state])); if (target_taskno) { --GvXjxJ+pjyke8COw--