From 7f008c9e6a3cbb248f5b6e8638af4b9d5225981b Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sun, 21 Apr 2019 20:10:51 -0600 Subject: [PATCH] Change valid_user_defined_cmd_name_p to return bool This changes valid_user_defined_cmd_name_p to return bool. gdb/ChangeLog 2019-05-04 Tom Tromey * cli/cli-decode.c (valid_user_defined_cmd_name_p): Return bool. * command.h (valid_user_defined_cmd_name_p): Channge return type. --- gdb/ChangeLog | 5 +++++ gdb/cli/cli-decode.c | 8 ++++---- gdb/command.h | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 7eb5d9aef31..aa55b77b37f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2019-05-04 Tom Tromey + + * cli/cli-decode.c (valid_user_defined_cmd_name_p): Return bool. + * command.h (valid_user_defined_cmd_name_p): Channge return type. + 2019-05-04 Raul Tambre * python/lib/gdb/prompt.py (_ExtendedPrompt) diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c index 50430953c72..72e2a970097 100644 --- a/gdb/cli/cli-decode.c +++ b/gdb/cli/cli-decode.c @@ -1328,13 +1328,13 @@ find_command_name_length (const char *text) This is a stricter subset of all gdb commands, see find_command_name_length. */ -int +bool valid_user_defined_cmd_name_p (const char *name) { const char *p; if (*name == '\0') - return FALSE; + return false; /* Alas "42" is a legitimate user-defined command. In the interests of not breaking anything we preserve that. */ @@ -1346,10 +1346,10 @@ valid_user_defined_cmd_name_p (const char *name) || *p == '_') ; /* Ok. */ else - return FALSE; + return false; } - return TRUE; + return true; } /* This routine takes a line of TEXT and a CLIST in which to start the diff --git a/gdb/command.h b/gdb/command.h index 4a239a71965..35006cc339e 100644 --- a/gdb/command.h +++ b/gdb/command.h @@ -133,7 +133,7 @@ extern struct cli_suppress_notification cli_suppress_notification; /* API to the manipulation of command lists. */ -extern int valid_user_defined_cmd_name_p (const char *name); +extern bool valid_user_defined_cmd_name_p (const char *name); /* Const-correct variant of the above. */ -- 2.30.2