FYI: more cast removal
Tom Tromey
tromey@redhat.com
Wed Jan 30 18:45:00 GMT 2013
I'm checking this in.
I did a more thorough search for unneeded casts to char* in
dwarf2read.c. This patch removes the easy offenders.
Tested by rebuilding.
There are still many more places that could use constification in
dwarf2read.
Tom
2013-01-30 Tom Tromey <tromey@redhat.com>
* dwarf2read.c (compute_delayed_physnames, read_call_site_scope)
(read_structure_type, read_enumeration_type): Remove cast.
Index: dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.744
diff -u -r1.744 dwarf2read.c
--- dwarf2read.c 30 Jan 2013 17:19:57 -0000 1.744
+++ dwarf2read.c 30 Jan 2013 18:44:17 -0000
@@ -6762,7 +6762,7 @@
const char *physname;
struct fn_fieldlist *fn_flp
= &TYPE_FN_FIELDLIST (mi->type, mi->fnfield_index);
- physname = dwarf2_physname ((char *) mi->name, mi->die, cu);
+ physname = dwarf2_physname (mi->name, mi->die, cu);
fn_flp->fn_fields[mi->index].physname = physname ? physname : "";
}
}
@@ -9808,7 +9808,7 @@
"physname, for referencing DIE 0x%x [in module %s]"),
die->offset.sect_off, objfile->name);
else
- SET_FIELD_PHYSNAME (call_site->target, (char *) target_physname);
+ SET_FIELD_PHYSNAME (call_site->target, target_physname);
}
else
{
@@ -11254,7 +11254,7 @@
{
/* The name is already allocated along with this objfile, so
we don't need to duplicate it for the type. */
- TYPE_TAG_NAME (type) = (char *) name;
+ TYPE_TAG_NAME (type) = name;
if (die->tag == DW_TAG_class_type)
TYPE_NAME (type) = TYPE_TAG_NAME (type);
}
@@ -11557,7 +11557,7 @@
TYPE_CODE (type) = TYPE_CODE_ENUM;
name = dwarf2_full_name (NULL, die, cu);
if (name != NULL)
- TYPE_TAG_NAME (type) = (char *) name;
+ TYPE_TAG_NAME (type) = name;
attr = dwarf2_attr (die, DW_AT_byte_size, cu);
if (attr)
More information about the Gdb-patches
mailing list