[4/8] constify init_type
Tom Tromey
tromey@redhat.com
Fri Jan 11 20:16:00 GMT 2013
This is a simple patch to constify the argument to init_type.
This change made me realize how to save some memory in a subsequent
patch.
Tom
* gdbtypes.c (init_type): Make 'name' const.
* gdbtypes.h (init_type): Update.
---
gdb/gdbtypes.c | 2 +-
gdb/gdbtypes.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
index 85ffbf1..62bf589 100644
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -1946,7 +1946,7 @@ allocate_gnat_aux_type (struct type *type)
struct type *
init_type (enum type_code code, int length, int flags,
- char *name, struct objfile *objfile)
+ const char *name, struct objfile *objfile)
{
struct type *type;
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 8899ef4..4bd2ce9 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -1425,7 +1425,7 @@ extern struct type *alloc_type_copy (const struct type *);
extern struct gdbarch *get_type_arch (const struct type *);
/* Helper function to construct objfile-owned types. */
-extern struct type *init_type (enum type_code, int, int, char *,
+extern struct type *init_type (enum type_code, int, int, const char *,
struct objfile *);
/* Helper functions to construct architecture-owned types. */
--
1.7.7.6
More information about the Gdb-patches
mailing list