]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
constify value_aggregate_elt
authorTom Tromey <tromey@redhat.com>
Thu, 27 Mar 2014 18:16:38 +0000 (12:16 -0600)
committerTom Tromey <tromey@redhat.com>
Mon, 14 Apr 2014 17:42:18 +0000 (11:42 -0600)
While working on another patch I realized that value_aggregate_elt's
"name" parameter ought to be const.  This patch implements this.

2014-04-14  Tom Tromey  <tromey@redhat.com>

* valops.c (value_aggregate_elt, value_struct_elt_for_reference)
(value_namespace_elt, value_maybe_namespace_elt): Make "name"
const.
* value.h (value_aggregate_elt): Update.

gdb/ChangeLog
gdb/valops.c
gdb/value.h

index 14a37d85fc733fd5939315bc7909f5cb241670af..f0aea98b2a86ce37c96885d8de3daf6b7b9754dc 100644 (file)
@@ -1,3 +1,10 @@
+2014-04-14  Tom Tromey  <tromey@redhat.com>
+
+       * valops.c (value_aggregate_elt, value_struct_elt_for_reference)
+       (value_namespace_elt, value_maybe_namespace_elt): Make "name"
+       const.
+       * value.h (value_aggregate_elt): Update.
+
 2014-04-14  Tom Tromey  <tromey@redhat.com>
 
        * dwarf2read.c (read_enumeration_type): Handle DW_AT_type.
index a1553795e5e1a04a0a07a8c3cb392aad82327c69..8c252d6e2929991a4d91ec8d7a0cb88e11539112 100644 (file)
@@ -83,15 +83,15 @@ oload_classification classify_oload_match (struct badness_vector *,
 
 static struct value *value_struct_elt_for_reference (struct type *,
                                                     int, struct type *,
-                                                    char *,
+                                                    const char *,
                                                     struct type *,
                                                     int, enum noside);
 
 static struct value *value_namespace_elt (const struct type *,
-                                         char *, int , enum noside);
+                                         const char *, int , enum noside);
 
 static struct value *value_maybe_namespace_elt (const struct type *,
-                                               char *, int,
+                                               const char *, int,
                                                enum noside);
 
 static CORE_ADDR allocate_space_in_inferior (int);
@@ -3027,7 +3027,7 @@ destructor_name_p (const char *name, struct type *type)
    the comment before value_struct_elt_for_reference.  */
 
 struct value *
-value_aggregate_elt (struct type *curtype, char *name,
+value_aggregate_elt (struct type *curtype, const char *name,
                     struct type *expect_type, int want_address,
                     enum noside noside)
 {
@@ -3108,7 +3108,7 @@ compare_parameters (struct type *t1, struct type *t2, int skip_artificial)
 
 static struct value *
 value_struct_elt_for_reference (struct type *domain, int offset,
-                               struct type *curtype, char *name,
+                               struct type *curtype, const char *name,
                                struct type *intype, 
                                int want_address,
                                enum noside noside)
@@ -3337,7 +3337,7 @@ value_struct_elt_for_reference (struct type *domain, int offset,
 
 static struct value *
 value_namespace_elt (const struct type *curtype,
-                    char *name, int want_address,
+                    const char *name, int want_address,
                     enum noside noside)
 {
   struct value *retval = value_maybe_namespace_elt (curtype, name,
@@ -3359,7 +3359,7 @@ value_namespace_elt (const struct type *curtype,
 
 static struct value *
 value_maybe_namespace_elt (const struct type *curtype,
-                          char *name, int want_address,
+                          const char *name, int want_address,
                           enum noside noside)
 {
   const char *namespace_name = TYPE_TAG_NAME (curtype);
index f8466690e0d306bb9904a25fba8f9b7881edcc66..9425a0ef11f68da2b6711b43a7304cb7c0118e32 100644 (file)
@@ -676,7 +676,7 @@ extern struct value *value_struct_elt_bitpos (struct value **argp,
                                              const char *err);
 
 extern struct value *value_aggregate_elt (struct type *curtype,
-                                         char *name,
+                                         const char *name,
                                          struct type *expect_type,
                                          int want_address,
                                          enum noside noside);