Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 98599 invoked from network); 18 May 2005 19:31:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 18 May 2005 19:31:28 -0000 Received: (qmail 92341 invoked by uid 500); 18 May 2005 18:40:45 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 92163 invoked by uid 500); 18 May 2005 18:40:41 -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 92091 invoked by uid 99); 18 May 2005 18:40:40 -0000 X-ASF-Spam-Status: No, hits=0.1 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from illustrious.concentric.net (HELO illustrious.cnchost.com) (207.155.252.7) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 18 May 2005 11:40:38 -0700 Received: from rcsv650.rowe-clan.net (c-24-13-128-132.hsd1.il.comcast.net [24.13.128.132]) by illustrious.cnchost.com id MAA28700; Wed, 18 May 2005 12:36:38 -0400 (EDT) [ConcentricHost SMTP Relay 1.17] Errors-To: Message-Id: <6.2.1.2.2.20050518102708.05adb110@pop3.rowe-clan.net> X-Mailer: QUALCOMM Windows Eudora Version 6.2.1.2 Date: Wed, 18 May 2005 10:58:47 -0500 To: Joe Orton From: "William A. Rowe, Jr." Subject: Re: LP64/P64 model API issue #2 Cc: dev@apr.apache.org In-Reply-To: <20050518143535.GA12745@redhat.com> References: <6.2.1.2.2.20050516133724.07370a90@pop3.rowe-clan.net> <20050517140136.GB5421@redhat.com> <6.2.1.2.2.20050518023918.04b1d790@pop3.rowe-clan.net> <20050518143535.GA12745@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N At 09:35 AM 5/18/2005, Joe Orton wrote: >On Wed, May 18, 2005 at 02:41:48AM -0500, William Rowe wrote: >> At 09:01 AM 5/17/2005, Joe Orton wrote: >> >On Mon, May 16, 2005 at 01:39:20PM -0500, William Rowe wrote: >> >> Issue #1; How to manipulate nelts in apr_table_entry? >> >> >> >> We can preserve the existing behavior of nelts, defining it as >> >> a simple int. A few casts are required out of the result of some >> >> pointer arithmetic. >> > >> >Can you explain what casts are needed exactly, and why? >> >> It's embodied by the patch below - the delta of two pointer >> offsets result in a size_t (by definition). On LP64/P64, the >> sizeof(int) < sizeof(size_t). > >The code is really fine in both places - you're really out here to fix >compiler warnings, right? No, I'm using the compiler warnings to identify code with the wrong apr_size_t/apr_off_t/int choice of arguments. The patch only fixes emits we are willing to accept... > But a different compiler could now issue a >new warning in table_mergesort: > > for (i = 0; i + 1 < n; i += 2) { > >for comparison of (apr_size_t) i and (int) n since they have both >different size and signedness. So that's not improved the code quality >a great deal really. Very true. As table_mergesort is a static local function, this is easy to clear up without a cast. That said; on an LP64 platform, we *could* use size_t instead of int as the nelts domain in apr-util v2.0. Question: Do we want to?