From: Simon Marchi Date: Wed, 18 Nov 2015 16:20:22 +0000 (-0500) Subject: Constify value_string X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7cc3f8e23b5c19a50722adefce986230b191e9cd;p=binutils-gdb.git 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d92ba43e6d3..d1b40b8f7a8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2015-11-18 Simon Marchi + + * valops.c (value_string): Constify 'ptr' parameter. + * value.h (value_string): Constify 'ptr' parameter. + 2015-11-18 Simon Marchi Pedro Alves diff --git a/gdb/valops.c b/gdb/valops.c index 67e6afe548d..5e5f685c11b 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 94a22340dce..eea0e594d59 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,