Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 55650 invoked from network); 7 Nov 2010 23:51:43 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 7 Nov 2010 23:51:43 -0000 Received: (qmail 26934 invoked by uid 500); 7 Nov 2010 23:52:14 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 26882 invoked by uid 500); 7 Nov 2010 23:52:14 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 26875 invoked by uid 99); 7 Nov 2010 23:52:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Nov 2010 23:52:14 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=10.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [198.117.0.122] (HELO ndmsnpf02.ndc.nasa.gov) (198.117.0.122) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 07 Nov 2010 23:52:05 +0000 Received: from ndjsppt05.ndc.nasa.gov (ndjsppt05.ndc.nasa.gov [198.117.1.104]) by ndmsnpf02.ndc.nasa.gov (Postfix) with ESMTP id E4A8A1080B1; Sun, 7 Nov 2010 17:51:43 -0600 (CST) Received: from ndjshub01.ndc.nasa.gov (ndjshub01-pub.ndc.nasa.gov [198.117.1.160]) by ndjsppt05.ndc.nasa.gov (8.14.3/8.14.3) with ESMTP id oA7NphJt018508; Sun, 7 Nov 2010 17:51:43 -0600 Received: from [10.0.1.3] (64.142.82.7) by smtp01.ndc.nasa.gov (198.117.1.160) with Microsoft SMTP Server (TLS) id 8.3.106.1; Sun, 7 Nov 2010 17:51:41 -0600 Subject: Re: [PATCH] %lld support in apr_snprintf() MIME-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset="us-ascii" From: Chris Knight In-Reply-To: Date: Sun, 7 Nov 2010 15:51:39 -0800 CC: APR Developer List Content-Transfer-Encoding: quoted-printable Message-ID: <1DAE160F-A799-4E68-85F4-4AA7477EC3B8@nasa.gov> References: <37818C6C-E90A-4DA4-A57B-91E8A4612077@temme.net> <4CD3066E.7010402@rowe-clan.net> <1D4C0A5A-5966-41A9-AB53-F3963CD59E80@temme.net> To: Jeff Trawick X-Mailer: Apple Mail (2.1081) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.2.15,1.0.148,0.0.0000 definitions=2010-11-07_07:2010-11-05,2010-11-07,1970-01-01 signatures=0 X-Virus-Checked: Checked by ClamAV on apache.org Exactly, the problem only appears on 64-bit Snow Leopard. See my patch = in Bugzilla, which I've verified. (Unsure if the below would also work, = been a long time since I diagnosed.) On Nov 7, 2010, at 3:36 PM, Jeff Trawick wrote: > On Sun, Nov 7, 2010 at 5:18 PM, Jeff Trawick = wrote: >> On Sun, Nov 7, 2010 at 5:07 PM, Sander Temme = wrote: >>>=20 >>> On Nov 4, 2010, at 12:15 PM, William A. Rowe Jr. wrote: >>>=20 >>>> Looks good here. >>>=20 >>> If folks find this unproblematic, can someone please commit it? I = don't have karma here. >>>=20 >>> Thanks, >>=20 >> looks fine to me; starting to try it out now >=20 > The patch is apparently not needed to make %lld work in 32-bit mode on > Leopard since APR_INT64_T_FMT is %lld. > It didn't make %lld work in 64-bit mode. >=20 > What are the cases where you see this help out? >=20 > I guess you're on Snow Leopard? >=20 > Here's what I tried in 64-bit mode: >=20 > Index: strings/apr_snprintf.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 > --- strings/apr_snprintf.c (revision 1032408) > +++ strings/apr_snprintf.c (working copy) > @@ -832,6 +832,11 @@ > else if (*fmt =3D=3D 'l') { > var_type =3D IS_LONG; > fmt++; > + /* Catch the %lld type modifier for long long and its = ilk */ > + if (*fmt =3D=3D 'l') { > + var_type =3D IS_QUAD; > + fmt++; > + } > } > else if (*fmt =3D=3D 'h') { > var_type =3D IS_SHORT; >=20 >=20 > ndex: testfmt.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 > --- testfmt.c (revision 1032408) > +++ testfmt.c (working copy) > @@ -126,6 +126,9 @@ >=20 > apr_snprintf(buf, sizeof buf, "%" APR_INT64_T_FMT, ibig); > ABTS_STR_EQUAL(tc, "-314159265358979323", buf); > + > + apr_snprintf(buf, sizeof buf, "%lld", ibig); > + ABTS_STR_EQUAL(tc, "-314159265358979323", buf); > } >=20 > static void error_fmt(abts_case *tc, void *data) >=20 > ./testall -v testfmt > testfmt : /Line 131: expected <-314159265358979323>, but = saw <%ld> > FAILED 1 of 10 > Failed Tests Total Fail Failed % > =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 > testfmt 10 1 10.00%