From patchwork Thu Mar 27 20:11:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 321 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx22.g.dreamhost.com (caibbdcaabij.dreamhost.com [208.113.200.189]) by wilcox.dreamhost.com (Postfix) with ESMTP id 79EBE3600B7 for ; Thu, 27 Mar 2014 13:11:54 -0700 (PDT) Received: by homiemail-mx22.g.dreamhost.com (Postfix, from userid 14314964) id 1F5A74434428; Thu, 27 Mar 2014 13:11:54 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx22.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx22.g.dreamhost.com (Postfix) with ESMTPS id D8B8743FCB3D for ; Thu, 27 Mar 2014 13:11:53 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; q=dns; s= default; b=riLPX0bBCjRYEeJIlaSSPSMF1wZUEbehQwhqvNpwBEsp9/JGHzPFN +sGyU/sra8ahgHkj0ZiBJhjU+P9aWVwx/lyObwxPLUquxR+IQJprpi1DJrZt1fDD PI2/Za+D69FW89aiuW2B1yEnJF6fHmu2PaR55S+U9U0AJydsWcDdd8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id; s=default; bh=FRfhCuNul5ezyxhoOdHLPHb1Krw=; b=tHh20UPUS3X3dCjX7MYB5q7dCGm5 Gw8G8Odx8E9JmA9gawgKvmia+IPUQlXa5ybPelCIIS6y21pwTEZXuWF6eWotHyQF QQxPdKpcrHc4MdGru+9ElWYjKPRbd2z5m1u/9t8rFWdC5jwwq3568W4mu1TvsF/Q zyy5pB0HR+AmTdc= Received: (qmail 10774 invoked by alias); 27 Mar 2014 20:11:49 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 10685 invoked by uid 89); 27 Mar 2014 20:11:49 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 27 Mar 2014 20:11:47 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s2RKBjRV013491 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 27 Mar 2014 16:11:46 -0400 Received: from barimba.redhat.com (ovpn-113-169.phx2.redhat.com [10.3.113.169]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s2RKBj83026295; Thu, 27 Mar 2014 16:11:45 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] constify value_aggregate_elt Date: Thu, 27 Mar 2014 14:11:40 -0600 Message-Id: <1395951100-8142-1-git-send-email-tromey@redhat.com> X-DH-Original-To: gdb@patchwork.siddhesh.in While working on another patch I realized that value_aggregate_elt's "name" parameter ought to be const. This patch implements this. 2014-03-27 Tom Tromey * valops.c (value_aggregate_elt, value_struct_elt_for_reference) (value_namespace_elt, value_maybe_namespace_elt): Make "name" const. * value.h (value_aggregate_elt): Update. --- gdb/ChangeLog | 7 +++++++ gdb/valops.c | 14 +++++++------- gdb/value.h | 2 +- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/gdb/valops.c b/gdb/valops.c index cf195a3..a10dbd6 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -83,15 +83,15 @@ oload_classification classify_oload_match (struct badness_vector *, static struct value *value_struct_elt_for_reference (struct type *, int, struct type *, - char *, + const char *, struct type *, int, enum noside); static struct value *value_namespace_elt (const struct type *, - char *, int , enum noside); + const char *, int , enum noside); static struct value *value_maybe_namespace_elt (const struct type *, - char *, int, + const char *, int, enum noside); static CORE_ADDR allocate_space_in_inferior (int); @@ -3014,7 +3014,7 @@ destructor_name_p (const char *name, struct type *type) the comment before value_struct_elt_for_reference. */ struct value * -value_aggregate_elt (struct type *curtype, char *name, +value_aggregate_elt (struct type *curtype, const char *name, struct type *expect_type, int want_address, enum noside noside) { @@ -3095,7 +3095,7 @@ compare_parameters (struct type *t1, struct type *t2, int skip_artificial) static struct value * value_struct_elt_for_reference (struct type *domain, int offset, - struct type *curtype, char *name, + struct type *curtype, const char *name, struct type *intype, int want_address, enum noside noside) @@ -3324,7 +3324,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, static struct value * value_namespace_elt (const struct type *curtype, - char *name, int want_address, + const char *name, int want_address, enum noside noside) { struct value *retval = value_maybe_namespace_elt (curtype, name, @@ -3346,7 +3346,7 @@ value_namespace_elt (const struct type *curtype, static struct value * value_maybe_namespace_elt (const struct type *curtype, - char *name, int want_address, + const char *name, int want_address, enum noside noside) { const char *namespace_name = TYPE_TAG_NAME (curtype); diff --git a/gdb/value.h b/gdb/value.h index f846669..9425a0e 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -676,7 +676,7 @@ extern struct value *value_struct_elt_bitpos (struct value **argp, const char *err); extern struct value *value_aggregate_elt (struct type *curtype, - char *name, + const char *name, struct type *expect_type, int want_address, enum noside noside);