From: Sanimir Agovic <sanimir.agovic@intel.com>
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 [thread overview]
Message-ID: <1374577403-3356-3-git-send-email-sanimir.agovic@intel.com> (raw)
In-Reply-To: <1374577403-3356-1-git-send-email-sanimir.agovic@intel.com>
Dwarf form predicate functions do not modify their argument and thus made
them const.
gdb:
2013-07-23 Sanimir Agovic <sanimir.agovic@inte.com>
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
next prev parent reply other threads:[~2013-07-23 11:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-23 11:03 [PATCH 0/2] Minor dwarf2read cleanups Sanimir Agovic
2013-07-23 11:03 ` [PATCH 1/2] cleanup: rename is_ref_attr to attr_form_is_ref Sanimir Agovic
2013-07-23 13:55 ` Tom Tromey
2013-07-23 14:10 ` Agovic, Sanimir
2013-07-23 14:32 ` Tom Tromey
2013-07-23 11:03 ` Sanimir Agovic [this message]
2013-07-23 13:53 ` [PATCH 2/2] cleanup: constify argument passed to dwarf form predicates 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=1374577403-3356-3-git-send-email-sanimir.agovic@intel.com \
--to=sanimir.agovic@intel.com \
--cc=gdb-patches@sourceware.org \
/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