From owner-freebsd-current@FreeBSD.ORG Fri Dec 5 11:35:57 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C55E2106564A for ; Fri, 5 Dec 2008 11:35:57 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id F15E58FC19 for ; Fri, 5 Dec 2008 11:35:56 +0000 (UTC) (envelope-from avg@icyb.net.ua) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id NAA22188; Fri, 05 Dec 2008 13:35:32 +0200 (EET) (envelope-from avg@icyb.net.ua) Message-ID: <49391203.9070009@icyb.net.ua> Date: Fri, 05 Dec 2008 13:35:31 +0200 From: Andriy Gapon User-Agent: Thunderbird 2.0.0.18 (X11/20081124) MIME-Version: 1.0 To: Ed Schouten References: <7d6fde3d0812040324y3bf0901cy1f4a6d961362c314@mail.gmail.com> <20081205072229.GE18652@hoeg.nl> In-Reply-To: <20081205072229.GE18652@hoeg.nl> Content-Type: text/plain; charset=KOI8-U Content-Transfer-Encoding: 7bit Cc: Garrett Cooper , "current@freebsd.org" , Maksim Yevmenkin Subject: Re: RFC: small syscons and kbd patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Dec 2008 11:35:57 -0000 on 05/12/2008 09:22 Ed Schouten said the following: > * Maksim Yevmenkin wrote: >> the idea was to ensure that kbd->kb_locked variable only takes values >> 0 (zero) and 1 (one). > > I often use constructs like these to do that: > > foo = bar ? 1 : 0; > > Maybe !!bar is a lot shorter to write, I think the line above is a lot > easier to read. Another variation is: foo = (bar != 0); I think that this is something in the middle. BTW, gcc 4.2 produces exactly the same assembly for all 3 forms. -- Andriy Gapon