* ada-lang.c (ada_make_symbol_completion_list): Return a VEC.

* breakpoint.c (catch_syscall_completer): Return a VEC.
	* cli/cli-cmds.c (complete_command): Update.
	* cli/cli-decode.c (complete_on_cmdlist): Return a VEC.
	(complete_on_enum): Likewise.
	* command.h: Include gdb_vecs.h.
	(completer_ftype): Change return type.
	(complete_on_cmdlist, complete_on_enum): Likewise.
	* completer.c (noop_completer, filename_completer)
	(location_completer): Return a VEC.
	(add_struct_fields): Remove 'nextp' argument.  Change 'output'
	to a VEC.
	(expression_completer, complete_line_internal, complete_line)
	(command_completer): Return a VEC.
	(gdb_completion_word_break_characters, line_completion_function):
	Update.
	* completer.h: Include gdb_vecs.h.
	(complete_line, noop_completer, filename_completer)
	(expression_completer, location_completer, command_completer):
	Update.
	* f-lang.c (f_word_break_characters): Return a VEC.
	* interps.c (interpreter_completer): Return a VEC.
	* language.h (struct language_defn)
	<la_make_symbol_completion_list>: Return a VEC.
	* python/py-cmd.c (cmdpy_completer): Return a VEC.
	* symtab.c (free_completion_list): Take a VEC.
	(return_val_size, return_val_index): Remove.
	(return_val): Now a VEC.
	(completion_list_add_name): Update.
	(default_make_symbol_completion_list_break_on)
	(default_make_symbol_completion_list, make_symbol_completion_list)
	(make_symbol_completion_list_fn, make_file_symbol_completion_list):
	Return a VEC.
	(add_filename_to_list): Update.
	(struct add_partial_filename_data) <list_used, list_alloced>: Remove.
	<list>: Now a VEC.
	(maybe_add_partial_symtab_filename): Update.
	(make_source_files_completion_list): Return a VEC.
	* symtab.h (default_make_symbol_completion_list_break_on)
	(default_make_symbol_completion_list, make_symbol_completion_list)
	(make_symbol_completion_list_fn, make_file_symbol_completion_list)
	(make_source_files_completion_list): Update.
This commit is contained in:
Tom Tromey 2012-06-13 15:47:16 +00:00
parent 625e8578d7
commit 49c4e619f8
14 changed files with 230 additions and 334 deletions

View file

@ -5797,11 +5797,10 @@ ada_expand_partial_symbol_name (const char *name, void *user_data)
data->wild_match, data->encoded) != NULL;
}
/* Return a list of possible symbol names completing TEXT0. The list
is NULL terminated. WORD is the entire command on which completion
is made. */
/* Return a list of possible symbol names completing TEXT0. WORD is
the entire command on which completion is made. */
static char **
static VEC (char_ptr) *
ada_make_symbol_completion_list (char *text0, char *word)
{
char *text;
@ -5914,24 +5913,7 @@ ada_make_symbol_completion_list (char *text0, char *word)
}
}
/* Append the closing NULL entry. */
VEC_safe_push (char_ptr, completions, NULL);
/* Make a copy of the COMPLETIONS VEC before we free it, and then
return the copy. It's unfortunate that we have to make a copy
of an array that we're about to destroy, but there is nothing much
we can do about it. Fortunately, it's typically not a very large
array. */
{
const size_t completions_size =
VEC_length (char_ptr, completions) * sizeof (char *);
char **result = xmalloc (completions_size);
memcpy (result, VEC_address (char_ptr, completions), completions_size);
VEC_free (char_ptr, completions);
return result;
}
return completions;
}
/* Field Access */