summaryrefslogtreecommitdiff
path: root/gdb/p-typeprint.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2011-05-18 16:30:28 +0000
committerTom Tromey <tromey@redhat.com>2011-05-18 16:30:28 +0000
commitd0a4a5b2a9e8d88af8f90e2a617eea70000f07c6 (patch)
treefac48457adfa20e4263fb0088cb45750f360f9c0 /gdb/p-typeprint.c
parent48246fc491802387dce473f54713388d9678b94a (diff)
downloadgdb-d0a4a5b2a9e8d88af8f90e2a617eea70000f07c6.tar.gz
* value.c (value_fn_field): Constify.
* symtab.c (gdb_mangle_name): Constify. * stabsread.c (update_method_name_from_physname): Make 'physname' argument const. * p-typeprint.c (pascal_type_print_method_args): Make arguments const. Use explicit fputc_filtered loop. (pascal_type_print_base): Constify. * p-lang.h (pascal_type_print_method_args): Update. * linespec.c (add_matching_methods): Constify. (add_constructors): Likewise. * jv-typeprint.c (java_type_print_base): Constify. * gdbtypes.h (struct cplus_struct_type) <fn_fieldlist.fn_field.physname>: Now const. * dwarf2read.c (compute_delayed_physnames): Constify. (dwarf2_add_member_fn): Likewise. * c-typeprint.c (c_type_print_base): Constify. Use cleanups.
Diffstat (limited to 'gdb/p-typeprint.c')
-rw-r--r--gdb/p-typeprint.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c
index 54a761d464a..5ac3bc5431a 100644
--- a/gdb/p-typeprint.c
+++ b/gdb/p-typeprint.c
@@ -153,7 +153,7 @@ pascal_type_print_derivation_info (struct ui_file *stream, struct type *type)
/* Print the Pascal method arguments ARGS to the file STREAM. */
void
-pascal_type_print_method_args (char *physname, char *methodname,
+pascal_type_print_method_args (const char *physname, const char *methodname,
struct ui_file *stream)
{
int is_constructor = (strncmp (physname, "__ct__", 6) == 0);
@@ -173,8 +173,7 @@ pascal_type_print_method_args (char *physname, char *methodname,
while (isdigit (physname[0]))
{
int len = 0;
- int i;
- char storec;
+ int i, j;
char *argname;
while (isdigit (physname[len]))
@@ -183,10 +182,11 @@ pascal_type_print_method_args (char *physname, char *methodname,
}
i = strtol (physname, &argname, 0);
physname += len;
- storec = physname[i];
- physname[i] = 0;
+
+ for (j = 0; j < i; ++j)
+ fputc_filtered (physname[i], stream);
fputs_filtered (physname, stream);
- physname[i] = storec;
+
physname += i;
if (physname[0] != 0)
{
@@ -638,7 +638,7 @@ pascal_type_print_base (struct type *type, struct ui_file *stream, int show,
It might work for GNU pascal. */
for (j = 0; j < len2; j++)
{
- char *physname = TYPE_FN_FIELD_PHYSNAME (f, j);
+ const char *physname = TYPE_FN_FIELD_PHYSNAME (f, j);
int is_constructor = (strncmp (physname, "__ct__", 6) == 0);
int is_destructor = (strncmp (physname, "__dt__", 6) == 0);