From patchwork Sat Oct 19 20:53:29 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Simon Marchi (Code Review)" X-Patchwork-Id: 35161 Received: (qmail 91245 invoked by alias); 19 Oct 2019 20:53:33 -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 91236 invoked by uid 89); 19 Oct 2019 20:53:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=strncmp, startswith, HContent-Transfer-Encoding:8bit X-HELO: mx1.osci.io Received: from polly.osci.io (HELO mx1.osci.io) (8.43.85.229) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 19 Oct 2019 20:53:32 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id 4B2FF201A1; Sat, 19 Oct 2019 16:53:30 -0400 (EDT) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [8.43.85.239]) by mx1.osci.io (Postfix) with ESMTP id 538E0201A1 for ; Sat, 19 Oct 2019 16:53:29 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id 30D1620AF6 for ; Sat, 19 Oct 2019 16:53:29 -0400 (EDT) X-Gerrit-PatchSet: 1 Date: Sat, 19 Oct 2019 16:53:29 -0400 From: "Simon Marchi (Code Review)" To: gdb-patches@sourceware.org Message-ID: Auto-Submitted: auto-generated X-Gerrit-MessageType: newchange Subject: [review] Make startswith return a bool X-Gerrit-Change-Id: I1c11b9bb7f89b3885c1bb55097adb5be6d333ad4 X-Gerrit-Change-Number: 162 X-Gerrit-ChangeURL: X-Gerrit-Commit: cda621229ba30b777858f7c61166cd4fc8ca7785 References: Reply-To: simon.marchi@polymtl.ca, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3 Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/162 ...................................................................... Make startswith return a bool gdb/ChangeLog: * gdbsupport/common-utils.h (startswith): Change return type to bool. Change-Id: I1c11b9bb7f89b3885c1bb55097adb5be6d333ad4 --- M gdb/gdbsupport/common-utils.h 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/gdb/gdbsupport/common-utils.h b/gdb/gdbsupport/common-utils.h index a5312cb..e96fc21 100644 --- a/gdb/gdbsupport/common-utils.h +++ b/gdb/gdbsupport/common-utils.h @@ -110,10 +110,9 @@ extern char *safe_strerror (int); -/* Return non-zero if the start of STRING matches PATTERN, zero - otherwise. */ +/* Return true if the start of STRING matches PATTERN, false otherwise. */ -static inline int +static inline bool startswith (const char *string, const char *pattern) { return strncmp (string, pattern, strlen (pattern)) == 0;