/* Line completion stuff for GDB, the GNU debugger.
- Copyright (C) 2000-2015 Free Software Foundation, Inc.
+ Copyright (C) 2000-2017 Free Software Foundation, Inc.
This file is part of GDB.
char *s;
file_to_match = (char *) xmalloc (colon - text + 1);
- strncpy (file_to_match, text, colon - text + 1);
+ strncpy (file_to_match, text, colon - text);
+ file_to_match[colon - text] = '\0';
/* Remove trailing colons and quotes from the file name. */
for (s = file_to_match + (colon - text);
s > file_to_match;
for (;;)
{
type = check_typedef (type);
- if (TYPE_CODE (type) != TYPE_CODE_PTR
- && TYPE_CODE (type) != TYPE_CODE_REF)
+ if (TYPE_CODE (type) != TYPE_CODE_PTR && !TYPE_IS_REFERENCE (type))
break;
type = TYPE_TARGET_TYPE (type);
}
static void
free_completion_tracker (void *p)
{
- completion_tracker_t *tracker_ptr = p;
+ completion_tracker_t *tracker_ptr = (completion_tracker_t *) p;
htab_delete (*tracker_ptr);
*tracker_ptr = NULL;
/* Bit-flags for selecting what the register and/or register-group
completer should complete on. */
-enum reg_completer_targets
+enum reg_completer_target
{
complete_register_names = 0x1,
complete_reggroup_names = 0x2
};
+DEF_ENUM_FLAGS_TYPE (enum reg_completer_target, reg_completer_targets);
/* Complete register names and/or reggroup names based on the value passed
in TARGETS. At least one bit in TARGETS must be set. */
static VEC (char_ptr) *
reg_or_group_completer_1 (struct cmd_list_element *ignore,
const char *text, const char *word,
- enum reg_completer_targets targets)
+ reg_completer_targets targets)
{
VEC (char_ptr) *result = NULL;
size_t len = strlen (word);