This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [PATCH] Make maint.c:match_substring const-correct
- From: Michael Snyder <msnyder at redhat dot com>
- To: Mark Kettenis <kettenis at science dot uva dot nl>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Thu, 27 Dec 2001 11:29:28 -0800
- Subject: Re: [PATCH] Make maint.c:match_substring const-correct
- Organization: Red Hat, Inc.
- References: <200112271537.fBRFbfH35990@elgar.my.domain>
Mark Kettenis wrote:
>
> Fixes a warning on FreeBSD 4.4. Checked in as obvious.
>
> Mark
Thank you.
>
> Index: ChangeLog
> from Mark Kettenis <kettenis@gnu.org>
>
> * maint.c (match_substring): Make parameters `string' and `substr'
> const. Make local variable `tok' const.
>
> 2001-12-27 Mark Kettenis <kettenis@gnu.org>
>
> Index: maint.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/maint.c,v
> retrieving revision 1.19
> diff -u -p -r1.19 maint.c
> --- maint.c 2001/12/21 17:30:02 1.19
> +++ maint.c 2001/12/27 15:36:43
> @@ -189,10 +189,10 @@ maintenance_info_command (char *arg, int
> /* Mini tokenizing lexer for 'maint info sections' command. */
>
> static int
> -match_substring (char *string, char *substr)
> +match_substring (const char *string, const char *substr)
> {
> int substr_len = strlen(substr);
> - char *tok;
> + const char *tok;
>
> while ((tok = strstr (string, substr)) != NULL)
> {