diff options
author | Simon Marchi <simon.marchi@ericsson.com> | 2015-11-18 11:20:22 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@ericsson.com> | 2015-11-18 11:20:22 -0500 |
commit | 7cc3f8e23b5c19a50722adefce986230b191e9cd (patch) | |
tree | c201525c8f0e3fab6971bce155966f36a62bd494 /gdb | |
parent | 79f338988c53625a3ab3fba63f06c6ffd224e9ff (diff) | |
download | gdb-7cc3f8e23b5c19a50722adefce986230b191e9cd.zip gdb-7cc3f8e23b5c19a50722adefce986230b191e9cd.tar.gz gdb-7cc3f8e23b5c19a50722adefce986230b191e9cd.tar.bz2 |
Constify value_string
If we constify value_cstring, we might as well constify this one.
gdb/ChangeLog:
* valops.c (value_string): Constify 'ptr' parameter.
* value.h (value_string): Constify 'ptr' parameter.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/valops.c | 2 | ||||
-rw-r--r-- | gdb/value.h | 2 |
3 files changed, 7 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d92ba43..d1b40b8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,4 +1,9 @@ 2015-11-18 Simon Marchi <simon.marchi@ericsson.com> + + * valops.c (value_string): Constify 'ptr' parameter. + * value.h (value_string): Constify 'ptr' parameter. + +2015-11-18 Simon Marchi <simon.marchi@ericsson.com> Pedro Alves <palves@redhat.com> * break-catch-sig.c (signal_catchpoint_print_one): Add cast. diff --git a/gdb/valops.c b/gdb/valops.c index 67e6afe..5e5f685 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -1649,7 +1649,7 @@ value_cstring (const char *ptr, ssize_t len, struct type *char_type) string may contain embedded null bytes. */ struct value * -value_string (char *ptr, ssize_t len, struct type *char_type) +value_string (const char *ptr, ssize_t len, struct type *char_type) { struct value *val; int lowbound = current_language->string_lower_bound; diff --git a/gdb/value.h b/gdb/value.h index 94a2234..eea0e59 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -698,7 +698,7 @@ extern void value_free_to_mark (struct value *mark); extern struct value *value_cstring (const char *ptr, ssize_t len, struct type *char_type); -extern struct value *value_string (char *ptr, ssize_t len, +extern struct value *value_string (const char *ptr, ssize_t len, struct type *char_type); extern struct value *value_array (int lowbound, int highbound, |