Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Keith Seitz <keiths@redhat.com>
Cc: GDB Patches <gdb-patches@sourceware.org>
Subject: Re: [RFA] "constify" parse_exp_1
Date: Tue, 12 Mar 2013 10:18:00 -0000	[thread overview]
Message-ID: <513F00EF.5040001@redhat.com> (raw)
In-Reply-To: <513E5612.9020607@redhat.com>

On 03/11/2013 10:09 PM, Keith Seitz wrote:

> 2013-03-07  Keith Seitz  <keiths@redhat.com>
> 
>     * ada-lang.c (ada_read_renaming_var_value): Pass const
>     pointer to expression string to parse_exp_1.
>     (craete_excep_cond_exprs): Likewise.

s/craete/create

>     * ax-gdb.c (agent_eval_command_one): Likewise.
>     (maint_agent_printf_command): Likewise.
>     Constify much of the string handling/parsing.
>     * breakpoint.c (set_breakpoint_condition): Pass const
>     pointer to expression string to parse_exp_1.
>     (update_watchpoint): Likewise.
>     (parse_cmd_to_aexpr): Constify string handling.
>     Pass const pointer to parse_exp_1.
>     (init_breakpoint_sal): Pass const pointer to parse_exp_1.
>     (find_condition_and_thread): Likewise.
>     Make TOK const.
>     (watch_command_1): Make ARG const.

(Minor note: pedantically, uppercase is used when talking
about the value of the variable, rather than the variable
itself.)


> --- cli/cli-utils.h	12 Feb 2013 19:03:55 -0000	1.18
> +++ cli/cli-utils.h	11 Mar 2013 21:57:24 -0000
> @@ -101,7 +101,9 @@ extern const char *skip_spaces_const (co
>  /* Skip leading non-whitespace characters in INP, returning an updated
>     pointer.  If INP is NULL, return NULL.  */
>
> -extern char *skip_to_space (char *inp);
> +#define skip_to_space(INP) ((char *) skip_to_space_const ((INP)))

Double (())s not necessary:

  #define skip_to_space(INP) ((char *) skip_to_space_const (INP))

Can you please add:

  + /* A const-correct version of the above.  */

  extern const char *skip_to_space_const (const char *inp);

Just like skip_spaces_const has too.

Otherwise this all looks good to me.

-- 
Pedro Alves


  reply	other threads:[~2013-03-12 10:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-08  0:12 Keith Seitz
2013-03-08  0:22 ` Pedro Alves
2013-03-08  1:02   ` Keith Seitz
2013-03-08 12:27     ` Pedro Alves
2013-03-08 13:55       ` Pedro Alves
2013-03-09  1:00         ` Pedro Alves
2013-03-09  1:04           ` Keith Seitz
2013-03-11 22:09             ` Keith Seitz
2013-03-12 10:18               ` Pedro Alves [this message]
2013-03-12 17:40                 ` Keith Seitz
2013-03-08 14:54     ` Tom Tromey
2013-03-11 16:50       ` Keith Seitz
2013-03-11 18:30         ` Tom Tromey

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=513F00EF.5040001@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=keiths@redhat.com \
    /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