Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B356011609 for ; Fri, 20 Jun 2014 14:18:15 +0000 (UTC) Received: (qmail 26997 invoked by uid 500); 20 Jun 2014 14:18:13 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 26923 invoked by uid 500); 20 Jun 2014 14:18:13 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 26913 invoked by uid 99); 20 Jun 2014 14:18:13 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Jun 2014 14:18:13 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy includes SPF record at spf.trusted-forwarder.org) Received: from [76.96.30.80] (HELO qmta08.emeryville.ca.mail.comcast.net) (76.96.30.80) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Jun 2014 14:18:07 +0000 Received: from omta08.emeryville.ca.mail.comcast.net ([76.96.30.12]) by qmta08.emeryville.ca.mail.comcast.net with comcast id GdYX1o0040FhH24A8eHnfz; Fri, 20 Jun 2014 14:17:47 +0000 Received: from [192.168.199.10] ([69.251.80.74]) by omta08.emeryville.ca.mail.comcast.net with comcast id GeFL1o00N1cCKD98UeHmTT; Fri, 20 Jun 2014 14:17:46 +0000 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.2\)) Subject: Re: svn commit: r1603863 - in /httpd/httpd/trunk/modules: aaa/mod_auth_basic.c http/http_filters.c From: Jim Jagielski In-Reply-To: Date: Fri, 20 Jun 2014 10:17:45 -0400 Cc: cvs@httpd.apache.org Content-Transfer-Encoding: quoted-printable Message-Id: <6D153625-492F-404D-AEA5-D232425A0D9E@jaguNET.com> References: <20140619124306.15BA0238899C@eris.apache.org> <410AA19E-760D-4808-88BF-97DAB69B1F72@jaguNET.com> <43A05E25-5C1F-4BB3-872E-070975BD2744@jaguNET.com> To: dev@httpd.apache.org X-Mailer: Apple Mail (2.1878.2) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1403273867; bh=9im9CV/uIjM025OqHXwHbGjffo2E6DueoSYRVeSNRTU=; h=Received:Received:Content-Type:Mime-Version:Subject:From:Date: Message-Id:To; b=XoYI75VzI1xYc81P7mbDd8WYF4gR/El6NEgpRhl5nvlU+Aev7ww6287lkrFsbA1fl lujAyYNxGgZBSH9nPRCAjSnGk+fZzAM52Zdpk8d7brR/s+6BgzjQsxtwz7gyURthdu QqtcY4E9scvhG+gozxUFrq44lHzge44yev7PHRvW5mzWBdXV9UYgMno5yjOQxKhWEo 6URXUgs62xafci3bLeJpg+yYKnIXUL7+gR3bvRgtPlbo8yptddbKcRGg2ChEzs9dVa bulJJrHEu5UHa6BaTDFfCGYG8mHbD2xE7ELxB4vE5kQVl3J1UwjtC71G9R3vQLbXIU zP0JbdevEzLgA== X-Virus-Checked: Checked by ClamAV on apache.org What I meant was "true or false"... Sorry for the confusion. On Jun 20, 2014, at 9:06 AM, Yann Ylavic wrote: > I can't agree with you on this. >=20 > You first say a bit is either 0 or 1, which is not true for a signed > bit (0 or -1), and confirms somehow we should use unsigned here. > A good compiler should also complain about setting 1 to something that > can only take 0 or -1, and we did that before this commit. > The unambigous solution would be to use the bool type, but that's > another story, and the closest alternative is to use *unsigned* bit > field of size 1. >=20 > BTW, I can revert this since the code using it does not compare the > bit explicitely, but I find signed bit fields quite error prone if the > value is not meant to be used for signed things (which isn't the case > here). >=20 > On Fri, Jun 20, 2014 at 1:51 PM, Jim Jagielski = wrote: >> Besides that, any compiler worth its salt should complain. >>=20 >> On Jun 20, 2014, at 7:50 AM, Jim Jagielski wrote: >>=20 >>> Who does that w/ bit fields? You either check if it's >>> true/false or you use the expected bit operations. >>>=20 >>> On Jun 19, 2014, at 9:29 AM, Yann Ylavic = wrote: >>>=20 >>>> On Thu, Jun 19, 2014 at 2:59 PM, Jim Jagielski = wrote: >>>>>=20 >>>>> On Jun 19, 2014, at 8:43 AM, ylavic@apache.org wrote: >>>>>=20 >>>>>> Author: ylavic >>>>>> Date: Thu Jun 19 12:43:05 2014 >>>>>> New Revision: 1603863 >>>>>>=20 >>>>>> URL: http://svn.apache.org/r1603863 >>>>>> Log: >>>>>> Use unsigned bit flags (otherwise the non-zero value to be used = is -1). >>>>>>=20 >>>>>=20 >>>>> I don't understand that at all... A bit is either 1 or 0. >>>>>=20 >>>>=20 >>>> Well, it depends on what you are doing with that bit... >>>>=20 >>>> #include >>>> int main(int argc, const char *argv[]) >>>> { >>>> struct { >>>> int s:1; >>>> } bitfield; >>>>=20 >>>> bitfield.s =3D 1; >>>> if (bitfield.s > 0) { >>>> printf("positive\n"); >>>> } >>>> else { >>>> printf("negative or nul\n"); >>>> } >>>> if (bitfield.s =3D=3D 1) { >>>> printf("one\n"); >>>> } >>>> else { >>>> printf("not one\n"); >>>> } >>>>=20 >>>> return 0; >>>> } >>>>=20 >>>> $ ./bitfield >>>> negative or nul >>>> not one >>>>=20 >>>=20 >>=20 >=20