From owner-svn-src-all@FreeBSD.ORG Fri Jul 18 05:22:08 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 048629A1 for ; Fri, 18 Jul 2014 05:22:08 +0000 (UTC) Received: from nm37-vm1.bullet.mail.bf1.yahoo.com (nm37-vm1.bullet.mail.bf1.yahoo.com [72.30.238.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id AAD3F27BF for ; Fri, 18 Jul 2014 05:22:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1405660532; bh=75xiGiDu5IgxkkNbNyIlGWoTtk73zWrJcG+lm6VzeYs=; h=Received:Received:Received:X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer; b=dVWbNdqRyY8C7DHMeaVI3Da4G40+kNAxSmDJzuiAt+fqA4Z8+fABrwT76UehMrCmYS1bSYG031wgSEG2gs/FRwz7hE8SJZka3mbL7itNTOa9KDj+slZaQ/fW+NIxOAHMJ+uNtLgv5ZAtdoGzfH/qS4IeMKXfnE9qUddjSENCiYsWuz7bmaM1oKpz0o6uhVVDc8NS56QfPm8WAyMOBIg+8OibCIk/6CvvObYMspKCxGXTXM4VTWi5L7MCkPA98RSS+0a5YY5DDq2t7Dqx4X64lpgO8hkT+PzBniErD8sG3zN1pya4dVjJcL3JY+uAX67D1noXqLepjtBiyWpGBlQ/Gw== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=yahoo.com; b=LAUwJ/gebpHAeDp+rXKkP0gjY1Eufgy9YUWOlCdE0abQDh+mPbnHqrPapBNDgKPRa1EvXSz0pCT2JqoqBUVwQZ6XVvSpSeuz6ZH/yhIEVcLtSmbRkgqOuJxYgyj0LG39r/+bZe9QYPaRSgSthMT9j//LFB9Xy5kMOS4KXhobU8oq1X38yh26rOkmvixrL/9yDn/YtPVAXs6n0NYcs5vQQTLTu+/Ikvl/Q+9eU8oJ2gJy5ynPnbDEQexcRQgceu1bbeVnMHIOAHFEWAX1YOKUouUKFGPZM6LtSMuuLhWI6FC6q+VWytToQs7ahfSg2kLR5Ygvy7RNuPHNwhZ01RGA8A==; Received: from [98.139.215.142] by nm37.bullet.mail.bf1.yahoo.com with NNFMP; 18 Jul 2014 05:15:32 -0000 Received: from [98.139.211.197] by tm13.bullet.mail.bf1.yahoo.com with NNFMP; 18 Jul 2014 05:15:32 -0000 Received: from [127.0.0.1] by smtp206.mail.bf1.yahoo.com with NNFMP; 18 Jul 2014 05:15:32 -0000 X-Yahoo-Newman-Id: 245052.95761.bm@smtp206.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: km92zJsVM1ksZHkiU59QTpzQAijCcZszI4bta8ZEwXovR7j 7JoJ0B1VvRmWOfVBSnf4D14TbwQj3KJFE9X82M47XdLXIgg9vhF2VCZYji1p fTmI1rPNzcLTtN4bDFgpuDnqOmuOkbyVxg4khWerSA_Um0jjuhOgn9b8Flqk MwSKkAu5fmuSvqN_T9FDROCJTGb5.t8nwARsbzKJefon2793zmE1wlIPHlJh SBuw2BTjQNLMu7vwLHlFC7Qpco86ebCAsI3Nfe_gw6lKlUQdAjGBdz3htWNt hvCZkMXs1Nn1OQjurteDdiY29oseiKT0rowRjg4nTGj.CSTeFHF09KcZ_xIj fgXCxHsG2HJ.JJe9NhBxvdmYPok3ZOIffmo40YOgOdWzyjnTu_BMnqUNiKdO o8T6Nim0XAjnfv.u8_fcc9l0QPTRsy0myyRZoVt3YsoukhnKQV5p3c_Jgf05 5YHsQt55n1WTc.bFWtDJRFcOlIrR._u.4VaHhMbZ2anlmgZvcTW_fjQbDPqQ TKboVJzGrbaOt5hEgwV7MEwbK X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: svn commit: r268826 - head/include From: Pedro Giffuni In-Reply-To: <20140718131924.O1045@besplex.bde.org> Date: Fri, 18 Jul 2014 00:15:30 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201407180249.s6I2nfiF062643@svn.freebsd.org> <20140718131924.O1045@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.1878.6) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jul 2014 05:22:08 -0000 Hi; Il giorno 17/lug/2014, alle ore 23:35, Bruce Evans = ha scritto: > On Fri, 18 Jul 2014, Pedro F. Giffuni wrote: >=20 >> Log: >> Minor sorting to match the NetBSD header >=20 > Unsorting. >=20 > 2 other style bugs (extra blank lines). >=20 >> MFC after: 3 days >> Obtained from: NetBSD >=20 > Please no. OK, I will revert. >=20 >> Modified: >> head/include/search.h >>=20 >> Modified: head/include/search.h >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >> --- head/include/search.h Fri Jul 18 01:35:20 2014 = (r268825) >> +++ head/include/search.h Fri Jul 18 02:49:41 2014 = (r268826) >> @@ -1,8 +1,8 @@ >> /*- >> - * Written by J.T. Conklin >> + * Written by J.T. Conklin >> * Public domain. >> * >> - * $NetBSD: search.h,v 1.12 1999/02/22 10:34:28 christos Exp $ >> + * $NetBSD: search.h,v 1.18 2005/07/06 15:47:15 drochner Exp $ >> * $FreeBSD$ >> */ >>=20 >> @@ -49,12 +49,14 @@ __BEGIN_DECLS >> int hcreate(size_t); >> void hdestroy(void); >> ENTRY *hsearch(ENTRY, ACTION); >> -void insque(void *, void *); >> + >> void *lfind(const void *, const void *, size_t *, size_t, >> int (*)(const void *, const void *)); >> void *lsearch(const void *, void *, size_t *, size_t, >> int (*)(const void *, const void *)); >> +void insque(void *, void *); >> void remque(void *); >> + >> void *tdelete(const void * __restrict, void ** __restrict, >> int (*)(const void *, const void *)); >> void *tfind(const void *, void * const *, >=20 > This does less than undo the style fixes made in FreeBSD, mostly in > 2002 (it doesn't undo removing __P(()) or the indentation fix for > twalk). >=20 NetBSD also removed __P(()) on this header. I noticed those changes and also the lack of bsearch. > The churn for unsorting insque() and the extra blank lines was already > very complicated and ugly: > - originally (in 4.4BSD-Lite), lfind(), lsearch(), insque() and = remque() were > compatibility cruft in libcompat. This was reflected by = intentionally > not declaring them in any header. > - then in 2000, search.h was imported from NetBSD. The deprecation of = the > functions was broken by declaring them there. It was only hinted at = by > unsorting them into a subsection in the middle of the file, with = insque() > unsorted internally exactly as above, and extra blank lines to = delimit > the subsection, exactly as above. The current commit is a not quite > complete regression to this version. > - then in rev.1.2 in 2000, the subsection was commented out and marked > as depricated (sic). The style of the rest of the commit was as good > as its spelling. It also commented out bsearch(). The "depricated" > comment at the beginning of the section made the extra blank lines > non-extra, but the commit also removed the leading blank line so > the subsection looked like it was attached to the previous one. > - then in rev.1.3 in 2000, after I complained about 1.2, all the style > bugs were fixed by removing all the commented out sections and the > remaining extra blank line. > - then in rev.1.8 in 2002, a comment was added about insque(), = lsearch() > and remque() being missing. lfind() was missing in the comment. See > below about where they were. > - then in rev.1.9 in 2002, insque() and remque() were moved back here = to > go with moving them from libcompat to libc. They were correctly > sorted and not placed in an subsection. > - then in rev.1.10 in 2002, lfind() and lsearch() were moved back = here. > There was no unsorting to fix for them, and they were not placed in > a subsection. >=20 > bsearch() is in C90. C90 of course doesn't have , and it = put > bsearch() in . 4.4BSD also doesn't have , and > declared bsearch() in the correct place. This was broken in FreeBSD > in 2000 by importing the "original" version of from NetBSD. > The bug (extra misplaced declaration of bsearch()) only lived for 6 > days. >=20 > The other 4 churned functions were standardized by POSIX in 2001, so > importing them and search.h was just in time to prepare for this = version > of POSIX and removing them in search.h within 6 days of the import was > just in time to break this. FreeBSD didn't declare the functions in > any standard header before search.h was imported. They were = intentionally > left out and had been dead for 10-15 years before POSIX brought them > back. FreeBSD just had rotting bits in several places. There was a > private search.h in lib/libc/db/hash. This header came complete with > a comment about insque being depricated (sic), but didn't declare it. > ed/ed.h used to have a home made version of insque(), and ed/README > still has rotted bits documenting the defunct option NEED_INSQUE for > configuring this. >=20 > Since the other 4 churned functions are now standard, they shouldn't > be unsorted in a special unsorted undocumented subsection. They are > precisely as standard as all of the other functions in search.h. > search.h doesn't have any extensions, and the prototypes in it are > exactly as in POSIX.1-2001, except for minor formatting differences > and now the unsorting of insque() and the extra blank lines. >=20 The reason for re-sorting was that I want to bring the reentrant = versions hcreate_r(), hcdestroy_r() and hsearch_r() (GNU extensions) from = NetBSD. NetBSD also re-licensed their (hsearch.c) implementation under 2-clause BSD license after adding the reentrant versions. I will leave the reentrant functions properly #ifdef=92ed at the end of = the file. and I will post the code for review when it=92s ready. Pedro.