From patchwork Sat Oct 19 21:02:05 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: 35163 Received: (qmail 99948 invoked by alias); 19 Oct 2019 21:02:11 -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 99901 invoked by uid 89); 19 Oct 2019 21:02:10 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-19.9 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=HX-Languages-Length:1451 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 21:02:09 +0000 Received: by mx1.osci.io (Postfix, from userid 994) id E2333203AE; Sat, 19 Oct 2019 17:02:07 -0400 (EDT) Received: from gnutoolchain-gerrit.osci.io (gnutoolchain-gerrit.osci.io [8.43.85.239]) by mx1.osci.io (Postfix) with ESMTP id BBE7D201AD; Sat, 19 Oct 2019 17:02:05 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by gnutoolchain-gerrit.osci.io (Postfix) with ESMTP id B1ABA20AF7; Sat, 19 Oct 2019 17:02:05 -0400 (EDT) X-Gerrit-PatchSet: 2 Date: Sat, 19 Oct 2019 17:02:05 -0400 From: "Sourceware to Gerrit sync (Code Review)" To: Simon Marchi , gdb-patches@sourceware.org Auto-Submitted: auto-generated X-Gerrit-MessageType: merged Subject: [pushed] gdb: Make startswith return a bool X-Gerrit-Change-Id: I1c11b9bb7f89b3885c1bb55097adb5be6d333ad4 X-Gerrit-Change-Number: 162 X-Gerrit-ChangeURL: X-Gerrit-Commit: 2377111731972d841731bc674ed6a7fb3ab90a53 In-Reply-To: References: Reply-To: noreply@gnutoolchain-gerrit.osci.io, simon.marchi@polymtl.ca, gdb-patches@sourceware.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Gerrit/3.0.3 Message-Id: <20191019210205.B1ABA20AF7@gnutoolchain-gerrit.osci.io> Sourceware to Gerrit sync has submitted this change. Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/162 ...................................................................... gdb: Make startswith return a bool gdb/ChangeLog: * gdbsupport/common-utils.h (startswith): Change return type to bool. Change-Id: I1c11b9bb7f89b3885c1bb55097adb5be6d333ad4 --- M gdb/ChangeLog M gdb/gdbsupport/common-utils.h 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index d8e3fe1..7c737ac 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2019-10-19 Simon Marchi + + * gdbsupport/common-utils.h (startswith): Change return type to + bool. + 2019-10-19 Christian Biesinger * bcache.c (bcache::print_statistics): Use std::sort instead of qsort. 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;