From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 90696 invoked by alias); 6 Jul 2015 15:18:47 -0000 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 Received: (qmail 90643 invoked by uid 89); 6 Jul 2015 15:18:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.2 X-HELO: usevmg21.ericsson.net Received: from usevmg21.ericsson.net (HELO usevmg21.ericsson.net) (198.24.6.65) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 06 Jul 2015 15:18:43 +0000 Received: from EUSAAHC003.ericsson.se (Unknown_Domain [147.117.188.81]) by usevmg21.ericsson.net (Symantec Mail Security) with SMTP id 7B.F9.07675.6153A955; Mon, 6 Jul 2015 09:58:15 +0200 (CEST) Received: from [142.133.110.144] (147.117.188.8) by smtp-am.internal.ericsson.com (147.117.188.83) with Microsoft SMTP Server id 14.3.210.2; Mon, 6 Jul 2015 11:18:39 -0400 Message-ID: <559A9C4F.2040801@ericsson.com> Date: Mon, 06 Jul 2015 15:18:00 -0000 From: Simon Marchi User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Andrew Burgess , Subject: Re: [OBV][PATCH] gdb: tui_win_name: Make parameter and result const. References: In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-07/txt/msg00122.txt.bz2 On 15-07-06 11:15 AM, Andrew Burgess wrote: > I have pushed the following as obvious. > > Thanks, > Andrew > > --- > > This commit makes the parameter and the result for 'tui_win_name' > constant. There's one place in the code that is then updated as a > result of this change. > > gdb/ChangeLog: > > * tui/tui-data.c (tui_partial_win_by_name): Window name is const. > (tui_win_name): Make parameter and result const. > * tui/tui-data.h (tui_win_name): Make parameter and result const. > --- > gdb/ChangeLog | 6 ++++++ > gdb/tui/tui-data.c | 7 ++++--- > gdb/tui/tui-data.h | 2 +- > 3 files changed, 11 insertions(+), 4 deletions(-) > > diff --git a/gdb/ChangeLog b/gdb/ChangeLog > index 5131927..4636653 100644 > --- a/gdb/ChangeLog > +++ b/gdb/ChangeLog > @@ -1,3 +1,9 @@ > +2015-07-06 Andrew Burgess > + > + * tui/tui-data.c (tui_partial_win_by_name): Window name is const. > + (tui_win_name): Make parameter and result const. > + * tui/tui-data.h (tui_win_name): Make parameter and result const. > + > 2015-07-06 Patrick Palka > > * i386-tdep.c (i386_mpx_info_bounds): Don't call error, instead > diff --git a/gdb/tui/tui-data.c b/gdb/tui/tui-data.c > index ed42c8d..0c350d8 100644 > --- a/gdb/tui/tui-data.c > +++ b/gdb/tui/tui-data.c > @@ -384,7 +384,8 @@ tui_partial_win_by_name (char *name) > { > if (tui_win_list[i] != 0) > { > - char *cur_name = tui_win_name (&tui_win_list[i]->generic); > + const char *cur_name = > + tui_win_name (&tui_win_list[i]->generic); > > if (strlen (name) <= strlen (cur_name) > && startswith (cur_name, name)) > @@ -399,8 +400,8 @@ tui_partial_win_by_name (char *name) > > > /* Answer the name of the window. */ > -char * > -tui_win_name (struct tui_gen_win_info *win_info) > +const char * > +tui_win_name (const struct tui_gen_win_info *win_info) > { > char *name = (char *) NULL; Hi Andrew, I think you might as well make this variable const. Simon