mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-04 22:15:12 +08:00
C++ keyword cleanliness, mostly auto-generated
This patch renames symbols that happen to have names which are reserved keywords in C++. Most of this was generated with Tromey's cxx-conversion.el script. Some places where later hand massaged a bit, to fix formatting, etc. And this was rebased several times meanwhile, along with re-running the script, so re-running the script from scratch probably does not result in the exact same output. I don't think that matters anyway. gdb/ 2015-02-27 Tom Tromey <tromey@redhat.com> Pedro Alves <palves@redhat.com> Rename symbols whose names are reserved C++ keywords throughout. gdb/gdbserver/ 2015-02-27 Tom Tromey <tromey@redhat.com> Pedro Alves <palves@redhat.com> Rename symbols whose names are reserved C++ keywords throughout.
This commit is contained in:
48
gdb/symtab.c
48
gdb/symtab.c
@ -5028,44 +5028,44 @@ completion_list_add_name (const char *symname,
|
||||
of matches. Note that the name is moved to freshly malloc'd space. */
|
||||
|
||||
{
|
||||
char *new;
|
||||
char *newobj;
|
||||
enum maybe_add_completion_enum add_status;
|
||||
|
||||
if (word == sym_text)
|
||||
{
|
||||
new = xmalloc (strlen (symname) + 5);
|
||||
strcpy (new, symname);
|
||||
newobj = xmalloc (strlen (symname) + 5);
|
||||
strcpy (newobj, symname);
|
||||
}
|
||||
else if (word > sym_text)
|
||||
{
|
||||
/* Return some portion of symname. */
|
||||
new = xmalloc (strlen (symname) + 5);
|
||||
strcpy (new, symname + (word - sym_text));
|
||||
newobj = xmalloc (strlen (symname) + 5);
|
||||
strcpy (newobj, symname + (word - sym_text));
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Return some of SYM_TEXT plus symname. */
|
||||
new = xmalloc (strlen (symname) + (sym_text - word) + 5);
|
||||
strncpy (new, word, sym_text - word);
|
||||
new[sym_text - word] = '\0';
|
||||
strcat (new, symname);
|
||||
newobj = xmalloc (strlen (symname) + (sym_text - word) + 5);
|
||||
strncpy (newobj, word, sym_text - word);
|
||||
newobj[sym_text - word] = '\0';
|
||||
strcat (newobj, symname);
|
||||
}
|
||||
|
||||
add_status = maybe_add_completion (completion_tracker, new);
|
||||
add_status = maybe_add_completion (completion_tracker, newobj);
|
||||
|
||||
switch (add_status)
|
||||
{
|
||||
case MAYBE_ADD_COMPLETION_OK:
|
||||
VEC_safe_push (char_ptr, return_val, new);
|
||||
VEC_safe_push (char_ptr, return_val, newobj);
|
||||
break;
|
||||
case MAYBE_ADD_COMPLETION_OK_MAX_REACHED:
|
||||
VEC_safe_push (char_ptr, return_val, new);
|
||||
VEC_safe_push (char_ptr, return_val, newobj);
|
||||
throw_max_completions_reached_error ();
|
||||
case MAYBE_ADD_COMPLETION_MAX_REACHED:
|
||||
xfree (new);
|
||||
xfree (newobj);
|
||||
throw_max_completions_reached_error ();
|
||||
case MAYBE_ADD_COMPLETION_DUPLICATE:
|
||||
xfree (new);
|
||||
xfree (newobj);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -5665,30 +5665,30 @@ static void
|
||||
add_filename_to_list (const char *fname, const char *text, const char *word,
|
||||
VEC (char_ptr) **list)
|
||||
{
|
||||
char *new;
|
||||
char *newobj;
|
||||
size_t fnlen = strlen (fname);
|
||||
|
||||
if (word == text)
|
||||
{
|
||||
/* Return exactly fname. */
|
||||
new = xmalloc (fnlen + 5);
|
||||
strcpy (new, fname);
|
||||
newobj = xmalloc (fnlen + 5);
|
||||
strcpy (newobj, fname);
|
||||
}
|
||||
else if (word > text)
|
||||
{
|
||||
/* Return some portion of fname. */
|
||||
new = xmalloc (fnlen + 5);
|
||||
strcpy (new, fname + (word - text));
|
||||
newobj = xmalloc (fnlen + 5);
|
||||
strcpy (newobj, fname + (word - text));
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Return some of TEXT plus fname. */
|
||||
new = xmalloc (fnlen + (text - word) + 5);
|
||||
strncpy (new, word, text - word);
|
||||
new[text - word] = '\0';
|
||||
strcat (new, fname);
|
||||
newobj = xmalloc (fnlen + (text - word) + 5);
|
||||
strncpy (newobj, word, text - word);
|
||||
newobj[text - word] = '\0';
|
||||
strcat (newobj, fname);
|
||||
}
|
||||
VEC_safe_push (char_ptr, *list, new);
|
||||
VEC_safe_push (char_ptr, *list, newobj);
|
||||
}
|
||||
|
||||
static int
|
||||
|
Reference in New Issue
Block a user