From owner-svn-src-all@FreeBSD.ORG Tue May 19 05:34:47 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6495C8D1 for ; Tue, 19 May 2015 05:34:47 +0000 (UTC) Received: from nm44-vm6.bullet.mail.bf1.yahoo.com (nm44-vm6.bullet.mail.bf1.yahoo.com [216.109.115.30]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1D0521CC1 for ; Tue, 19 May 2015 05:34:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1432013301; bh=FeI+y70F6auNdfwqYylNFkcTO0Z57NyXDcac9gwLltY=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From:Subject; b=UzcVvPbvLoJB4LvBj7tu1W+/ouk5NqLGlbB0OTdK7nQ4nNhJYAIPIXMpc7tyFrTV4yPRMhlq7LSfLujiXubUNxSZ6ejtNzawMXci73OMi4TAHBsh1/lGDQL1JXwNXQhht+rxQM1y0RCtYy33LoD3/9PpQmLjnubVmxgvc5vRKcBjUADtURlHc9tmyF9SniFM6XwOKa++Bga/GVuQeAWHp5pVp52d+zaoER/MTZFpMqQ1q7GoO6Y+KDq4BGbr/B3luJoRZsKN+WCfhzxkxsP8VvaNalwsmNRFjqAlOFCh9YmyAdXENwjb8qqCY6tgLYfmgaEbegeK/F2vO4SebVilOw== Received: from [66.196.81.173] by nm44.bullet.mail.bf1.yahoo.com with NNFMP; 19 May 2015 05:28:21 -0000 Received: from [68.142.230.69] by tm19.bullet.mail.bf1.yahoo.com with NNFMP; 19 May 2015 05:28:21 -0000 Received: from [127.0.0.1] by smtp226.mail.bf1.yahoo.com with NNFMP; 19 May 2015 05:28:21 -0000 X-Yahoo-Newman-Id: 630517.76090.bm@smtp226.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: AOFLH10VM1nXfrQ1mBTcBEvkqYbQNDb5MUABrFkRiNt.6x7 HNCWf2dZI1.6uesSmSDI.wfMZOuWApdJgXVm.m5dIXeJkB.CPKFr9o7wiZ0M VJQraI6ObTBeUuM0PGDVLHZfzBCxv_wExAAT2mt3u8MtDmeWkubcs2cSTh5j 5jv5m9JANzu.ni.ow._vs0ePf_ByofG_ATLxbXXBLPMJNLSKlkulQXnvNwwO 3h01lGG6MWzPnC5i.EH5zfgay4FvMuPCovjz_RZJNFx.uK456z2Gwm9MjgYh yg0rqhA0fiLV1TK0PfETNmCs_w1HoUNQ0KMXJgFh5P08lIyQ4XZ7ojf_A4SI eiPTG6vzvZVnEzanUxnA2JY_UXoOeRNA7_sT54pDDRCc.0_Nyq1ncmjyA9OG HCcymEU80NkZLN.3OxM7jetCnjezDyK2vD2120vRmTFDOBxT6AjMfRlIWeRx 2pY1lqsLZCi0RSHLtTFiIUbjGCP0jiBcv7fvzoZSd6THDZP1b1qnTkQKFQdK ZWTjLljt2Fl7iZRz86TiM564G1S5t0XKb X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2098\)) Subject: Re: svn commit: r283088 - head/sys/ddb From: Pedro Giffuni In-Reply-To: <20150519135341.R2157@besplex.bde.org> Date: Tue, 19 May 2015 00:28:05 -0500 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-Id: References: <201505182227.t4IMRljx078812@svn.freebsd.org> <20150519113755.U1840@besplex.bde.org> <406A7AE3-1891-4B2C-B917-14C150EBBAB5@FreeBSD.org> <20150519135341.R2157@besplex.bde.org> To: Bruce Evans X-Mailer: Apple Mail (2.2098) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 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: Tue, 19 May 2015 05:34:47 -0000 > Il giorno 18/mag/2015, alle ore 23:34, Bruce Evans = ha scritto: >=20 > On Mon, 18 May 2015, Pedro Giffuni wrote: >=20 >>> Il giorno 18/mag/2015, alle ore 20:48, Bruce Evans = ha scritto: >>>=20 >>> On Mon, 18 May 2015, Pedro F. Giffuni wrote: >>>=20 >>>> Log: >>>> ddb: stop boolean screaming. >>>>=20 >>>> TRUE --> true >>>> FALSE--> false >>>>=20 >>>> Hinted by: NetBSD >>>=20 >>> This is not just churn to a style regression, but a type mismatch. >>=20 >> It is an attempt to reduce differences with NetBSD. >=20 > For that, apply the reverse change to NetBSD. >=20 Actually, the NetBSD code uses bool. (I hate CVS, commits are not = atomic.) >> One of the complaints of hear from newcomers to the ddb code is that >> the format is old-fashioned (it still had pre-ANSI headers not long = ago) >> and unmaintained. >=20 > It is fairly well maintained (not churned to unimprove its = portability). > Why would newcomers want too look at it? >=20 Unrelated fun: last year a student started adding support for CTF and = pretty printing of the kernel structures. I think the NetBSD guys have = been having fun with Lua. >>>> Modified: head/sys/ddb/db_break.c >>>> = =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/sys/ddb/db_break.c Mon May 18 22:14:06 2015 = (r283087) >>>> +++ head/sys/ddb/db_break.c Mon May 18 22:27:46 2015 = (r283088) >>>> @@ -155,12 +155,12 @@ db_find_breakpoint_here(db_addr_t addr) >>>> return db_find_breakpoint(db_map_addr(addr), addr); >>>> } >>>>=20 >>>> -static boolean_t db_breakpoints_inserted =3D TRUE; >>>> +static boolean_t db_breakpoints_inserted =3D true; >>>=20 >>> This code hasn't been churned to use the boolean type. It still = uses >>> boolean_t, which is plain int. TRUE and FALSE go with this type. = true >>> and false go with the boolean type. This probably makes no = difference, >>> because TRUE happens to be implemented with the same value as true = and >>> there are lots of implicit versions between the types. >>=20 >> Yes, I noticed the return types are still ints. It doesn=E2=80=99t = look difficult >> to convert it to use a real boolean type. In any case, I would = prefer to go >> forward (using bool) instead of reverting this change. >=20 > That wuld be sideways. >=20 > I forgot to mention (again) in my previous reply that boolean_t is a = mistake > by me. KNF code doesn't even use the ! operator, but uses explicit > comparison with 0. The boolean_t type and TRUE and FALSE are from = Mach. > They were used mainly in ddb and vm, and are still almost never used = in > kern. I used to like typedefs and a typedef for boolean types, and = didn't > know KNF very well, so in 1995 I moved the declaration of boolean_t = from > Mach vm code to sys/types.h to try to popularize it. This was a = mistake. > Fortunately, it is still rarely used in core kernel code. >=20 > The boolean type is also almost never used for syscalls. In = POSIX.1-2001, > is inherited from C99, but is never used for any other = POSIX > API. Using it for syscalls would mainly cause portability problems. >=20 OK, I do understand the kernel wants to keep the C dialect somewhat = limited, and adding stdbool.h doesn=E2=80=99t buy us any type safety here. I=E2=80=99ll revert the change (prob. tomorrow though). Pedro.