From: Simon Marchi <simon.marchi@ericsson.com>
To: Andrew Burgess <andrew.burgess@embecosm.com>,
<gdb-patches@sourceware.org>
Subject: Re: [OBV][PATCH] gdb: tui_win_name: Make parameter and result const.
Date: Mon, 06 Jul 2015 15:18:00 -0000 [thread overview]
Message-ID: <559A9C4F.2040801@ericsson.com> (raw)
In-Reply-To: <f41cbf58f4af65e8612585c45208f3690a39ea28.1436194706.git.andrew.burgess@embecosm.com>
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 <andrew.burgess@embecosm.com>
> +
> + * 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 <patrick@parcs.ath.cx>
>
> * 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
prev parent reply other threads:[~2015-07-06 15:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-06 15:15 Andrew Burgess
2015-07-06 15:18 ` Simon Marchi [this message]
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=559A9C4F.2040801@ericsson.com \
--to=simon.marchi@ericsson.com \
--cc=andrew.burgess@embecosm.com \
--cc=gdb-patches@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