From 8bcdb629a6d1e09a6c8ddc4ac205393eb6443366 Mon Sep 17 00:00:00 2001 From: kevinb Date: Wed, 11 Dec 2002 20:19:39 +0000 Subject: [PATCH] * gdbarch.sh (ADDRESS_CLASS_TYPE_FLAGS_TO_NAME) (ADDRESS_CLASS_NAME_TO_TYPE_FLAGS): Use ``const char *'' instead of ``char *'' for return and parameter types. * gdbarch.h, gdbarch.c: Regenerate. * gdbtypes.h, gdbtypes.c (address_space_int_to_name): Change return type from ``char *'' to ``const char *''. * c-typeprint.c (c_type_print_modifier): Make ``address_space_id'' const. --- gdb/ChangeLog | 11 +++++++++++ gdb/c-typeprint.c | 2 +- gdb/gdbarch.c | 4 ++-- gdb/gdbarch.h | 8 ++++---- gdb/gdbarch.sh | 4 ++-- gdb/gdbtypes.c | 2 +- gdb/gdbtypes.h | 2 +- 7 files changed, 22 insertions(+), 11 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 2643d4a853..0d263aca6f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +2002-12-11 Kevin Buettner + + * gdbarch.sh (ADDRESS_CLASS_TYPE_FLAGS_TO_NAME) + (ADDRESS_CLASS_NAME_TO_TYPE_FLAGS): Use ``const char *'' instead of + ``char *'' for return and parameter types. + * gdbarch.h, gdbarch.c: Regenerate. + * gdbtypes.h, gdbtypes.c (address_space_int_to_name): Change + return type from ``char *'' to ``const char *''. + * c-typeprint.c (c_type_print_modifier): Make ``address_space_id'' + const. + 2002-12-11 Mark Kettenis * i386-tdep.c: Include "dummy-frame.h". diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c index 6c5e815e2a..fa4683a862 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c @@ -300,7 +300,7 @@ c_type_print_modifier (struct type *type, struct ui_file *stream, int need_pre_space, int need_post_space) { int did_print_modifier = 0; - char *address_space_id; + const char *address_space_id; /* We don't print `const' qualifiers for references --- since all operators affect the thing referenced, not the reference itself, diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 03a4ae3326..938d9faaed 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -5368,7 +5368,7 @@ gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch) return gdbarch->address_class_type_flags_to_name != 0; } -char * +const char * gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags) { gdb_assert (gdbarch != NULL); @@ -5395,7 +5395,7 @@ gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch) } int -gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, char *name, int *type_flags_ptr) +gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr) { gdb_assert (gdbarch != NULL); if (gdbarch->address_class_name_to_type_flags == 0) diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index b8ad9a0e3b..0b2381f998 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -2762,14 +2762,14 @@ extern void set_gdbarch_address_class_type_flags (struct gdbarch *gdbarch, gdbar extern int gdbarch_address_class_type_flags_to_name_p (struct gdbarch *gdbarch); -typedef char * (gdbarch_address_class_type_flags_to_name_ftype) (struct gdbarch *gdbarch, int type_flags); -extern char * gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags); +typedef const char * (gdbarch_address_class_type_flags_to_name_ftype) (struct gdbarch *gdbarch, int type_flags); +extern const char * gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, int type_flags); extern void set_gdbarch_address_class_type_flags_to_name (struct gdbarch *gdbarch, gdbarch_address_class_type_flags_to_name_ftype *address_class_type_flags_to_name); extern int gdbarch_address_class_name_to_type_flags_p (struct gdbarch *gdbarch); -typedef int (gdbarch_address_class_name_to_type_flags_ftype) (struct gdbarch *gdbarch, char *name, int *type_flags_ptr); -extern int gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, char *name, int *type_flags_ptr); +typedef int (gdbarch_address_class_name_to_type_flags_ftype) (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr); +extern int gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, const char *name, int *type_flags_ptr); extern void set_gdbarch_address_class_name_to_type_flags (struct gdbarch *gdbarch, gdbarch_address_class_name_to_type_flags_ftype *address_class_name_to_type_flags); /* Is a register in a group */ diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 8458ae3c5e..e2da438173 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -676,8 +676,8 @@ v::NAME_OF_MALLOC:const char *:name_of_malloc::::"malloc":"malloc"::0:%s:NAME_OF v::CANNOT_STEP_BREAKPOINT:int:cannot_step_breakpoint::::0:0::0 v::HAVE_NONSTEPPABLE_WATCHPOINT:int:have_nonsteppable_watchpoint::::0:0::0 F:2:ADDRESS_CLASS_TYPE_FLAGS:int:address_class_type_flags:int byte_size, int dwarf2_addr_class:byte_size, dwarf2_addr_class -M:2:ADDRESS_CLASS_TYPE_FLAGS_TO_NAME:char *:address_class_type_flags_to_name:int type_flags:type_flags: -M:2:ADDRESS_CLASS_NAME_TO_TYPE_FLAGS:int:address_class_name_to_type_flags:char *name, int *type_flags_ptr:name, type_flags_ptr +M:2:ADDRESS_CLASS_TYPE_FLAGS_TO_NAME:const char *:address_class_type_flags_to_name:int type_flags:type_flags: +M:2:ADDRESS_CLASS_NAME_TO_TYPE_FLAGS:int:address_class_name_to_type_flags:const char *name, int *type_flags_ptr:name, type_flags_ptr # Is a register in a group m:::int:register_reggroup_p:int regnum, struct reggroup *reggroup:regnum, reggroup:::default_register_reggroup_p::0 EOF diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index c9cae4cda8..293adda891 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -416,7 +416,7 @@ address_space_name_to_int (char *space_identifier) /* Identify address space identifier by integer flag as defined in gdbtypes.h -- return the string version of the adress space name. */ -extern char * +const char * address_space_int_to_name (int space_flag) { struct gdbarch *gdbarch = current_gdbarch; diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index fe4b0f12bd..69f8cdb3df 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -1096,7 +1096,7 @@ extern void replace_type (struct type *, struct type *); extern int address_space_name_to_int (char *); -extern char *address_space_int_to_name (int); +extern const char *address_space_int_to_name (int); extern struct type *make_type_with_address_space (struct type *type, int space_identifier); -- 2.11.0