From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15754 invoked by alias); 13 Jul 2012 19:48:40 -0000 Received: (qmail 15744 invoked by uid 22791); 13 Jul 2012 19:48:39 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_NO,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout20.012.net.il (HELO mtaout20.012.net.il) (80.179.55.166) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 13 Jul 2012 19:48:28 +0000 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0M74003006U3GN00@a-mtaout20.012.net.il> for gdb-patches@sourceware.org; Fri, 13 Jul 2012 22:47:25 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M74003HL6Z1DM40@a-mtaout20.012.net.il>; Fri, 13 Jul 2012 22:47:25 +0300 (IDT) Date: Fri, 13 Jul 2012 19:48:00 -0000 From: Eli Zaretskii Subject: Re: [RFA libiberty, gdb] Add hashtab support to filename_ncmp.c and use it in gdb. In-reply-to: To: Doug Evans Cc: dj@redhat.com, gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org Reply-to: Eli Zaretskii Message-id: <83a9z3a1f5.fsf@gnu.org> References: <20120709181015.2FCA41E13A1@ruffy2.mtv.corp.google.com> <201207131921.q6DJLf5t002291@greed.delorie.com> X-IsSubscribed: yes 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 X-SW-Source: 2012-07/txt/msg00186.txt.bz2 > Date: Fri, 13 Jul 2012 12:36:44 -0700 > From: Doug Evans > Cc: gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org > > On Fri, Jul 13, 2012 at 12:21 PM, DJ Delorie wrote: > > > > I think it's confusing to have filename_cmp and filename_eq that do > > basically the same thing. Perhaps filename_eq should be > > filename_cmp_v or filename_cmp_hash or something, to indicate that > > it's *supposed* to be the same functionality as filename_cmp but with > > a different signature? > > To be clear, filename_cmp is to strcmp as filename_eq is to streq. > > ref: STREQ in libiberty/regex.c: > # define STREQ(s1, s2) ((strcmp (s1, s2) == 0)) > > Given that, I think the names are fine as is, but I'm happy to change them. Sorry if I'm missing something, but why do we need to advertise such a function at all? Given that libiberty already provides filename_cmp, isn't it trivial to write something like filename_eq whenever someone needs to use hashes of file names?