From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26187 invoked by alias); 12 Mar 2013 10:18:56 -0000 Received: (qmail 26176 invoked by uid 22791); 12 Mar 2013 10:18:55 -0000 X-SWARE-Spam-Status: No, hits=-8.9 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_SPAMHAUS_DROP,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 12 Mar 2013 10:18:25 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2CAIP5f018008 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 12 Mar 2013 06:18:25 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r2CAINiH006987; Tue, 12 Mar 2013 06:18:24 -0400 Message-ID: <513F00EF.5040001@redhat.com> Date: Tue, 12 Mar 2013 10:18:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130219 Thunderbird/17.0.3 MIME-Version: 1.0 To: Keith Seitz CC: GDB Patches Subject: Re: [RFA] "constify" parse_exp_1 References: <51392C56.7040302@redhat.com> <51392F3F.5090102@redhat.com> <51393886.9030602@redhat.com> <5139D92B.5090106@redhat.com> <5139EDDB.8080201@redhat.com> <513A899C.2030800@redhat.com> <513A8A80.4040905@redhat.com> <513E5612.9020607@redhat.com> In-Reply-To: <513E5612.9020607@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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: 2013-03/txt/msg00509.txt.bz2 On 03/11/2013 10:09 PM, Keith Seitz wrote: > 2013-03-07 Keith Seitz > > * 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