From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22030 invoked by alias); 13 Jul 2012 21:26:30 -0000 Received: (qmail 22016 invoked by uid 22791); 13 Jul 2012 21:26:29 -0000 X-SWARE-Spam-Status: No, hits=-5.5 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail-vc0-f169.google.com (HELO mail-vc0-f169.google.com) (209.85.220.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 13 Jul 2012 21:26:16 +0000 Received: by vcbfl10 with SMTP id fl10so3182370vcb.0 for ; Fri, 13 Jul 2012 14:26:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-system-of-record:x-gm-message-state; bh=+5gKbzTCq521I/ATIRzer0xdNWI24MNUUVE66jk79eQ=; b=ky8gUmLHBLzJtNOC3sHNIJIMJTQKcmh39gFfnQAdmdQmBwsve/fS9qTyfhFjNZxyT+ 6WGNxagtjZnm268u/OEjrcxMpQI0cS1e3NiXGKncuaFE3Ljhr9UHpjuAhwBRpfHs7a2R jXnPIccqiq1lRb5u1SZoY5IuRU861EdEIUkhCKbOOMaaU51NIMTXnASFNPCdQjBbMr3S alkBB4PduWztNeNpckmGXpaJ6dHk3EByQkasDV2gskjL6k7mvbR8UU4LfybT4YU9cya9 r90u+pHGG1JtWcetpXFLxBVyP/Djt89DVXSU4E9MLTRwSF0qxCYglM0H7RPeNw5LeoD8 wSxw== Received: by 10.220.204.212 with SMTP id fn20mr1322576vcb.43.1342214776197; Fri, 13 Jul 2012 14:26:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.204.212 with SMTP id fn20mr1322563vcb.43.1342214775794; Fri, 13 Jul 2012 14:26:15 -0700 (PDT) Received: by 10.52.157.4 with HTTP; Fri, 13 Jul 2012 14:26:15 -0700 (PDT) In-Reply-To: <83a9z3a1f5.fsf@gnu.org> References: <20120709181015.2FCA41E13A1@ruffy2.mtv.corp.google.com> <201207131921.q6DJLf5t002291@greed.delorie.com> <83a9z3a1f5.fsf@gnu.org> Date: Fri, 13 Jul 2012 21:26:00 -0000 Message-ID: Subject: Re: [RFA libiberty, gdb] Add hashtab support to filename_ncmp.c and use it in gdb. From: Doug Evans To: Eli Zaretskii Cc: dj@redhat.com, gcc-patches@gcc.gnu.org, gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-System-Of-Record: true X-Gm-Message-State: ALoCoQk7id4yyvZY8uNAFl/7kkSXX/yn2YL/utUkx6fSU12/NATop0VrsZ81hrKl9G5G2diuwwW7K5wcUx/+HpnZGVYobcEnS9uAg6S+WDej22OtyKCN2Y4Rm+TMsY30kGD+6MlWxxQDjLWAcT5tK+WVrqodoPx6avcK8wZtEYIu1VWpZlGduh98xJI/ob40llC27UqiIMKD 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/msg00191.txt.bz2 On Fri, Jul 13, 2012 at 12:47 PM, Eli Zaretskii wrote: >> 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? It's a "matched set" with filename_hash. The hashtab.c constructors take a hash_f function pointer and an eq_f function pointer.