From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28611 invoked by alias); 5 Mar 2015 18:18:22 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 28599 invoked by uid 89); 5 Mar 2015 18:18:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 05 Mar 2015 18:18:11 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id BCDCF28101; Thu, 5 Mar 2015 13:18:09 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id P63h6OsGDAId; Thu, 5 Mar 2015 13:18:09 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 7C56928100; Thu, 5 Mar 2015 13:18:09 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id E2D4B40EAD; Thu, 5 Mar 2015 10:18:07 -0800 (PST) Date: Thu, 05 Mar 2015 18:18:00 -0000 From: Joel Brobecker To: Gary Benson Cc: gdb-patches@sourceware.org, Andreas Arnez Subject: Re: [PATCH v2] New common function "startswith" Message-ID: <20150305181807.GC4604@adacore.com> References: <20150304092720.GA26337@blade.nx> <1425486409-16480-1-git-send-email-gbenson@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1425486409-16480-1-git-send-email-gbenson@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2015-03/txt/msg00162.txt.bz2 > This patch introduces a new inline common function "startswith" > which takes two string arguments and returns nonzero if the first > string starts with the second. It also updates the 295 places > where this logic was written out longhand to use the new function. > > Changes from the first version are: > > - The function is now inline. > - The arguments got renamed to "string" and "pattern". > - I found 115 more places to use it. > > Regression tested on RHEL 6.6 x86_64. > > Ok to commit? > -- > gdb/ChangeLog: > > * common/common-utils.h (startswith): New inline function. > All places where this logic was used updated to use the above. I didn't read the entire file all that carefully, just the first few pages of it. If it was a mechanical change, and then tested as you say, it's good enough for me, I think. OK to push! Thank you, -- Joel