From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26529 invoked by alias); 23 Jul 2013 11:03:51 -0000 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 Received: (qmail 26504 invoked by uid 89); 23 Jul 2013 11:03:51 -0000 X-Spam-SWARE-Status: No, score=-4.6 required=5.0 tests=AWL,BAYES_05,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RDNS_NONE,TO_NO_BRKTS_NORDNS autolearn=no version=3.3.1 Received: from Unknown (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 23 Jul 2013 11:03:50 +0000 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP; 23 Jul 2013 04:01:08 -0700 X-ExtLoop1: 1 Received: from irvmail001.ir.intel.com ([163.33.26.43]) by fmsmga001.fm.intel.com with ESMTP; 23 Jul 2013 04:03:42 -0700 Received: from ulliclel004.iul.intel.com (ulliclel004.iul.intel.com [172.28.50.125]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id r6NB3fJe027256 for ; Tue, 23 Jul 2013 12:03:41 +0100 Received: from ulliclel004.iul.intel.com (ulliclel004.iul.intel.com [127.0.0.1]) by ulliclel004.iul.intel.com (8.13.8/8.12.8/MailSET/client) with ESMTP id r6NB3emW003400 for ; Tue, 23 Jul 2013 13:03:40 +0200 Received: (from sagovic@localhost) by ulliclel004.iul.intel.com (8.13.8/8.13.1/Submit) id r6NB3Zoi003399 for gdb-patches@sourceware.org; Tue, 23 Jul 2013 13:03:35 +0200 From: Sanimir Agovic To: gdb-patches@sourceware.org Subject: [PATCH 2/2] cleanup: constify argument passed to dwarf form predicates Date: Tue, 23 Jul 2013 11:03:00 -0000 Message-Id: <1374577403-3356-3-git-send-email-sanimir.agovic@intel.com> In-Reply-To: <1374577403-3356-1-git-send-email-sanimir.agovic@intel.com> References: <1374577403-3356-1-git-send-email-sanimir.agovic@intel.com> X-SW-Source: 2013-07/txt/msg00530.txt.bz2 Dwarf form predicate functions do not modify their argument and thus made them const. gdb: 2013-07-23 Sanimir Agovic dwarf2read.c (attr_form_is_block): Make argument const. (attr_form_is_section_offset): Make argument const. (attr_form_is_constant): Make argument const. (attr_form_is_ref): Make argument const. Change-Id: Ide9aae7260e904b76470b48973037d43e23c180a --- gdb/dwarf2read.c | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 1ee36bb..6fe1686 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -1649,13 +1649,13 @@ static struct die_info *dwarf_alloc_die (struct dwarf2_cu *, int); static void dwarf_decode_macros (struct dwarf2_cu *, unsigned int, const char *, int); -static int attr_form_is_block (struct attribute *); +static int attr_form_is_block (const struct attribute *); -static int attr_form_is_section_offset (struct attribute *); +static int attr_form_is_section_offset (const struct attribute *); -static int attr_form_is_constant (struct attribute *); +static int attr_form_is_constant (const struct attribute *); -static int attr_form_is_ref (struct attribute *); +static int attr_form_is_ref (const struct attribute *); static void fill_in_loclist_baton (struct dwarf2_cu *cu, struct dwarf2_loclist_baton *baton, @@ -19795,7 +19795,7 @@ dwarf_decode_macros (struct dwarf2_cu *cu, unsigned int offset, if so return true else false. */ static int -attr_form_is_block (struct attribute *attr) +attr_form_is_block (const struct attribute *attr) { return (attr == NULL ? 0 : attr->form == DW_FORM_block1 @@ -19815,7 +19815,7 @@ attr_form_is_block (struct attribute *attr) of them. */ static int -attr_form_is_section_offset (struct attribute *attr) +attr_form_is_section_offset (const struct attribute *attr) { return (attr->form == DW_FORM_data4 || attr->form == DW_FORM_data8 @@ -19836,7 +19836,7 @@ attr_form_is_section_offset (struct attribute *attr) taken as section offsets, not constants. */ static int -attr_form_is_constant (struct attribute *attr) +attr_form_is_constant (const struct attribute *attr) { switch (attr->form) { @@ -19857,7 +19857,7 @@ attr_form_is_constant (struct attribute *attr) besides DW_FORM_ref_addr it is stored as cu_offset in the DWARF file. */ static int -attr_form_is_ref (struct attribute *attr) +attr_form_is_ref (const struct attribute *attr) { switch (attr->form) { -- 1.7.1.1