* bsd-kvm.c (bsd_kvm_open): Properly cast sentinel in concat call.

* coffread.c (patch_type, process_coff_symbol): Likewise.
* corelow.c (core_open): Likewise.
* dwarf2read.c (dwarf_decode_lines, dwarf2_start_subfile):
* language.c (set_lang_str, set_type_str, set_range_str)
(set_case_str): Likewise.
* source.c (add_path, openp): Likewise.
* stabsread.c: Likewise.
* top.c (init_history): Likewise.
* utils.c (xfullpath): Likewise.
* value.c (lookup_internalvar): Likewise.
* cli/cli-cmds.c (cd_command): Likewise.
* cli/cli-dump.c (add_dump_command): Likewise.
This commit is contained in:
Mark Kettenis 2005-07-04 13:29:13 +00:00
parent 540b09cb7d
commit 1754f103e6
13 changed files with 53 additions and 34 deletions

View file

@ -1,5 +1,19 @@
2005-07-04 Mark Kettenis <kettenis@gnu.org> 2005-07-04 Mark Kettenis <kettenis@gnu.org>
* bsd-kvm.c (bsd_kvm_open): Properly cast sentinel in concat call.
* coffread.c (patch_type, process_coff_symbol): Likewise.
* corelow.c (core_open): Likewise.
* dwarf2read.c (dwarf_decode_lines, dwarf2_start_subfile):
* language.c (set_lang_str, set_type_str, set_range_str)
(set_case_str): Likewise.
* source.c (add_path, openp): Likewise.
* stabsread.c: Likewise.
* top.c (init_history): Likewise.
* utils.c (xfullpath): Likewise.
* value.c (lookup_internalvar): Likewise.
* cli/cli-cmds.c (cd_command): Likewise.
* cli/cli-dump.c (add_dump_command): Likewise.
* i387-tdep.c (print_i387_value, print_i387_ext, i387_tag): Change * i387-tdep.c (print_i387_value, print_i387_ext, i387_tag): Change
type of first argument to `const gdb_byte *'. type of first argument to `const gdb_byte *'.
(i387_print_float_info, i387_register_to_value) (i387_print_float_info, i387_register_to_value)

View file

@ -70,7 +70,7 @@ bsd_kvm_open (char *filename, int from_tty)
filename = tilde_expand (filename); filename = tilde_expand (filename);
if (filename[0] != '/') if (filename[0] != '/')
{ {
temp = concat (current_directory, "/", filename, NULL); temp = concat (current_directory, "/", filename, (char *)NULL);
xfree (filename); xfree (filename);
filename = temp; filename = temp;
} }

View file

@ -366,9 +366,10 @@ cd_command (char *dir, int from_tty)
else else
{ {
if (IS_DIR_SEPARATOR (current_directory[strlen (current_directory) - 1])) if (IS_DIR_SEPARATOR (current_directory[strlen (current_directory) - 1]))
current_directory = concat (current_directory, dir, NULL); current_directory = concat (current_directory, dir, (char *)NULL);
else else
current_directory = concat (current_directory, SLASH_STRING, dir, NULL); current_directory = concat (current_directory, SLASH_STRING,
dir, (char *)NULL);
xfree (dir); xfree (dir);
} }

View file

@ -438,7 +438,7 @@ add_dump_command (char *name, void (*func) (char *args, char *mode),
&& c->doc[3] == 't' && c->doc[3] == 't'
&& c->doc[4] == 'e' && c->doc[4] == 'e'
&& c->doc[5] == ' ') && c->doc[5] == ' ')
c->doc = concat ("Append ", c->doc + 6, NULL); c->doc = concat ("Append ", c->doc + 6, (char *)NULL);
} }
/* Opaque data for restore_section_callback. */ /* Opaque data for restore_section_callback. */

View file

@ -1,6 +1,6 @@
/* Read coff symbol tables and convert to internal format, for GDB. /* Read coff symbol tables and convert to internal format, for GDB.
Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996,
1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc. Free Software Foundation, Inc.
Contributed by David D. Johnson, Brown University (ddj@cs.brown.edu). Contributed by David D. Johnson, Brown University (ddj@cs.brown.edu).
@ -1399,7 +1399,7 @@ patch_type (struct type *type, struct type *real_type)
{ {
if (TYPE_NAME (target)) if (TYPE_NAME (target))
xfree (TYPE_NAME (target)); xfree (TYPE_NAME (target));
TYPE_NAME (target) = concat (TYPE_NAME (real_target), NULL); TYPE_NAME (target) = concat (TYPE_NAME (real_target), (char *)NULL);
} }
} }
@ -1636,7 +1636,7 @@ process_coff_symbol (struct coff_symbol *cs,
} }
else else
TYPE_NAME (SYMBOL_TYPE (sym)) = TYPE_NAME (SYMBOL_TYPE (sym)) =
concat (DEPRECATED_SYMBOL_NAME (sym), NULL); concat (DEPRECATED_SYMBOL_NAME (sym), (char *)NULL);
} }
/* Keep track of any type which points to empty structured type, /* Keep track of any type which points to empty structured type,
@ -1671,7 +1671,7 @@ process_coff_symbol (struct coff_symbol *cs,
&& *DEPRECATED_SYMBOL_NAME (sym) != '~' && *DEPRECATED_SYMBOL_NAME (sym) != '~'
&& *DEPRECATED_SYMBOL_NAME (sym) != '.') && *DEPRECATED_SYMBOL_NAME (sym) != '.')
TYPE_TAG_NAME (SYMBOL_TYPE (sym)) = TYPE_TAG_NAME (SYMBOL_TYPE (sym)) =
concat (DEPRECATED_SYMBOL_NAME (sym), NULL); concat (DEPRECATED_SYMBOL_NAME (sym), (char *)NULL);
add_symbol_to_list (sym, &file_symbols); add_symbol_to_list (sym, &file_symbols);
break; break;

View file

@ -300,7 +300,7 @@ core_open (char *filename, int from_tty)
filename = tilde_expand (filename); filename = tilde_expand (filename);
if (filename[0] != '/') if (filename[0] != '/')
{ {
temp = concat (current_directory, "/", filename, NULL); temp = concat (current_directory, "/", filename, (char *)NULL);
xfree (filename); xfree (filename);
filename = temp; filename = temp;
} }

View file

@ -1,7 +1,7 @@
/* DWARF 2 debugging format support for GDB. /* DWARF 2 debugging format support for GDB.
Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
2004 2004, 2005
Free Software Foundation, Inc. Free Software Foundation, Inc.
Adapted by Gary Funck (gary@intrepid.com), Intrepid Technology, Adapted by Gary Funck (gary@intrepid.com), Intrepid Technology,
@ -6632,15 +6632,15 @@ dwarf_decode_lines (struct line_header *lh, char *comp_dir, bfd *abfd,
if (!IS_ABSOLUTE_PATH (include_name) && dir_name != NULL) if (!IS_ABSOLUTE_PATH (include_name) && dir_name != NULL)
{ {
include_name = include_name = concat (dir_name, SLASH_STRING,
concat (dir_name, SLASH_STRING, include_name, NULL); include_name, (char *)NULL);
make_cleanup (xfree, include_name); make_cleanup (xfree, include_name);
} }
if (!IS_ABSOLUTE_PATH (pst_filename) && pst->dirname != NULL) if (!IS_ABSOLUTE_PATH (pst_filename) && pst->dirname != NULL)
{ {
pst_filename = pst_filename = concat (pst->dirname, SLASH_STRING,
concat (pst->dirname, SLASH_STRING, pst_filename, NULL); pst_filename, (char *)NULL);
make_cleanup (xfree, pst_filename); make_cleanup (xfree, pst_filename);
} }
@ -6679,7 +6679,7 @@ dwarf2_start_subfile (char *filename, char *dirname)
if (!IS_ABSOLUTE_PATH (filename) && dirname != NULL) if (!IS_ABSOLUTE_PATH (filename) && dirname != NULL)
{ {
struct subfile *subfile; struct subfile *subfile;
char *fullname = concat (dirname, "/", filename, NULL); char *fullname = concat (dirname, "/", filename, (char *)NULL);
for (subfile = subfiles; subfile; subfile = subfile->next) for (subfile = subfiles; subfile; subfile = subfile->next)
{ {

View file

@ -412,7 +412,7 @@ set_lang_str (void)
if (language_mode == language_mode_auto) if (language_mode == language_mode_auto)
prefix = "auto; currently "; prefix = "auto; currently ";
language = concat (prefix, current_language->la_name, NULL); language = concat (prefix, current_language->la_name, (char *)NULL);
} }
static void static void
@ -440,7 +440,7 @@ set_type_str (void)
error (_("Unrecognized type check setting.")); error (_("Unrecognized type check setting."));
} }
type = concat (prefix, tmp, NULL); type = concat (prefix, tmp, (char *)NULL);
} }
static void static void
@ -468,7 +468,7 @@ set_range_str (void)
if (range) if (range)
xfree (range); xfree (range);
range = concat (pref, tmp, NULL); range = concat (pref, tmp, (char *)NULL);
} }
static void static void
@ -492,7 +492,7 @@ set_case_str (void)
} }
xfree (case_sensitive); xfree (case_sensitive);
case_sensitive = concat (prefix, tmp, NULL); case_sensitive = concat (prefix, tmp, (char *)NULL);
} }
/* Print out the current language settings: language, range and /* Print out the current language settings: language, range and

View file

@ -1,6 +1,6 @@
/* List lines of source files for GDB, the GNU debugger. /* List lines of source files for GDB, the GNU debugger.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of GDB. This file is part of GDB.
@ -487,10 +487,10 @@ add_path (char *dirname, char **which_path, int parse_separators)
name = tilde_expand (name); name = tilde_expand (name);
#ifdef HAVE_DOS_BASED_FILE_SYSTEM #ifdef HAVE_DOS_BASED_FILE_SYSTEM
else if (IS_ABSOLUTE_PATH (name) && p == name + 2) /* "d:" => "d:." */ else if (IS_ABSOLUTE_PATH (name) && p == name + 2) /* "d:" => "d:." */
name = concat (name, ".", NULL); name = concat (name, ".", (char *)NULL);
#endif #endif
else if (!IS_ABSOLUTE_PATH (name) && name[0] != '$') else if (!IS_ABSOLUTE_PATH (name) && name[0] != '$')
name = concat (current_directory, SLASH_STRING, name, NULL); name = concat (current_directory, SLASH_STRING, name, (char *)NULL);
else else
name = savestring (name, p - name); name = savestring (name, p - name);
make_cleanup (xfree, name); make_cleanup (xfree, name);
@ -563,15 +563,16 @@ add_path (char *dirname, char **which_path, int parse_separators)
c = old[prefix]; c = old[prefix];
old[prefix] = '\0'; old[prefix] = '\0';
temp = concat (old, tinybuf, name, NULL); temp = concat (old, tinybuf, name, (char *)NULL);
old[prefix] = c; old[prefix] = c;
*which_path = concat (temp, "", &old[prefix], NULL); *which_path = concat (temp, "", &old[prefix], (char *)NULL);
prefix = strlen (temp); prefix = strlen (temp);
xfree (temp); xfree (temp);
} }
else else
{ {
*which_path = concat (name, (old[0] ? tinybuf : old), old, NULL); *which_path = concat (name, (old[0] ? tinybuf : old),
old, (char *)NULL);
prefix = strlen (name); prefix = strlen (name);
} }
xfree (old); xfree (old);
@ -771,7 +772,7 @@ done:
char *f = concat (current_directory, char *f = concat (current_directory,
IS_DIR_SEPARATOR (current_directory[strlen (current_directory) - 1]) IS_DIR_SEPARATOR (current_directory[strlen (current_directory) - 1])
? "" : SLASH_STRING, ? "" : SLASH_STRING,
filename, NULL); filename, (char *)NULL);
*filename_opened = xfullpath (f); *filename_opened = xfullpath (f);
xfree (f); xfree (f);
} }

View file

@ -1,8 +1,8 @@
/* Support routines for decoding "stabs" debugging information format. /* Support routines for decoding "stabs" debugging information format.
Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Software Foundation, Inc. Free Software Foundation, Inc.
This file is part of GDB. This file is part of GDB.
@ -2527,7 +2527,8 @@ read_member_functions (struct field_info *fip, char **pp, struct type *type,
} }
else if (has_destructor && new_fnlist->fn_fieldlist.name[0] != '~') else if (has_destructor && new_fnlist->fn_fieldlist.name[0] != '~')
{ {
new_fnlist->fn_fieldlist.name = concat ("~", main_fn_name, NULL); new_fnlist->fn_fieldlist.name =
concat ("~", main_fn_name, (char *)NULL);
xfree (main_fn_name); xfree (main_fn_name);
} }
else if (!has_stub) else if (!has_stub)

View file

@ -1370,9 +1370,11 @@ init_history (void)
that was read. */ that was read. */
#ifdef __MSDOS__ #ifdef __MSDOS__
/* No leading dots in file names are allowed on MSDOS. */ /* No leading dots in file names are allowed on MSDOS. */
history_filename = concat (current_directory, "/_gdb_history", NULL); history_filename = concat (current_directory, "/_gdb_history",
(char *)NULL);
#else #else
history_filename = concat (current_directory, "/.gdb_history", NULL); history_filename = concat (current_directory, "/.gdb_history",
(char *)NULL);
#endif #endif
} }
read_history (history_filename); read_history (history_filename);

View file

@ -3030,9 +3030,9 @@ xfullpath (const char *filename)
directory separator, avoid doubling it. */ directory separator, avoid doubling it. */
real_path = gdb_realpath (dir_name); real_path = gdb_realpath (dir_name);
if (IS_DIR_SEPARATOR (real_path[strlen (real_path) - 1])) if (IS_DIR_SEPARATOR (real_path[strlen (real_path) - 1]))
result = concat (real_path, base_name, NULL); result = concat (real_path, base_name, (char *)NULL);
else else
result = concat (real_path, SLASH_STRING, base_name, NULL); result = concat (real_path, SLASH_STRING, base_name, (char *)NULL);
xfree (real_path); xfree (real_path);
return result; return result;

View file

@ -743,7 +743,7 @@ lookup_internalvar (char *name)
return var; return var;
var = (struct internalvar *) xmalloc (sizeof (struct internalvar)); var = (struct internalvar *) xmalloc (sizeof (struct internalvar));
var->name = concat (name, NULL); var->name = concat (name, (char *)NULL);
var->value = allocate_value (builtin_type_void); var->value = allocate_value (builtin_type_void);
release_value (var->value); release_value (var->value);
var->next = internalvars; var->next = internalvars;