From patchwork Sat May 4 20:11:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 32556 Received: (qmail 101309 invoked by alias); 4 May 2019 20:14:46 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 101213 invoked by uid 89); 4 May 2019 20:14:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:1670, interests X-HELO: gateway32.websitewelcome.com Received: from gateway32.websitewelcome.com (HELO gateway32.websitewelcome.com) (192.185.145.100) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 04 May 2019 20:14:44 +0000 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway32.websitewelcome.com (Postfix) with ESMTP id 65CF5106F19 for ; Sat, 4 May 2019 15:11:49 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id N10fhELs14FKpN10fheFu9; Sat, 04 May 2019 15:11:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=bfJBUOMwt0hWQu3ZabFdR4+MbLVsaJdt78fPXeRRraw=; b=UUE8VOkw1KaUjWj7jWuk7bFPLd h+uCsGYV2pvsyXFcmCHmq4pHHSTNwShE8z+rXJEPQaO7XPxy8Vn7AudBMXUbe/mtN/IwggorTnKcd 7i6d6fyEbtwP9rs52T6rJK5Ei; Received: from 97-122-168-123.hlrn.qwest.net ([97.122.168.123]:39978 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1hN10f-004Jf3-7O; Sat, 04 May 2019 15:11:49 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [FYI 1/7] Change valid_user_defined_cmd_name_p to return bool Date: Sat, 4 May 2019 14:11:41 -0600 Message-Id: <20190504201147.3095-2-tom@tromey.com> In-Reply-To: <20190504201147.3095-1-tom@tromey.com> References: <20190504201147.3095-1-tom@tromey.com> 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/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. */