Received: from mailgate002.isp.belgacom.be (mailgate002.isp.belgacom.be [195.238.6.87])
	by maildelivery002.isp.belgacom.be (Postfix) with ESMTP id C3231148013
	for <joris.at.lebbeke@skynet.be>; Mon, 26 May 2008 18:29:54 +0200 (CEST)
Authentication-Results: in.mx.skynet.be; dkim=neutral (message not signed) header.i=none
Received: from r153.dmsolutions.ca (HELO duke.maptools.org) ([209.217.116.153])
  by in.mx.skynet.be with ESMTP; 26 May 2008 18:29:53 +0200
Received: from duke.maptools.org (duke.maptools.org [127.0.0.1])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id m4QFll2M030742;
	Mon, 26 May 2008 11:48:48 -0400
Received: from mail.sidefx.com (mail.sidefx.com [38.99.137.163])
	by duke.maptools.org (8.12.11/8.12.10) with ESMTP id m4QFlkiF030738
	for <tiff@lists.maptools.org>; Mon, 26 May 2008 11:47:46 -0400
Received: from [192.168.235.105] (unknown [192.168.235.105])
	by mail.sidefx.com (Postfix) with ESMTP id 1AB1E5C04D;
	Mon, 26 May 2008 11:47:46 -0400 (EDT)
Message-ID: <483ADBA2.90504@sidefx.com>
Date: Mon, 26 May 2008 11:47:46 -0400
From: Edward Lam <edward@sidefx.com>
User-Agent: Thunderbird 2.0.0.14 (Windows/20080421)
MIME-Version: 1.0
To: Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
Subject: Re: [Tiff] beta2 release - lfind() problem on Win64
References: <48378FEB.3090402@pobox.com> <483AC835.8020202@sidefx.com>
	<Pine.SOC.4.64.0805261021590.1131@freddy.simplesystems.org>
In-Reply-To: <Pine.SOC.4.64.0805261021590.1131@freddy.simplesystems.org>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Cc: TIFF mailing list <tiff@lists.maptools.org>
X-BeenThere: tiff@lists.maptools.org
X-Mailman-Version: 2.1.4
Precedence: list
List-Id: TIFF and libtiff discussion <tiff.lists.maptools.org>
List-Unsubscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=unsubscribe>
List-Archive: <http://lists.maptools.org/mailman/private/tiff>
List-Post: <mailto:tiff@lists.maptools.org>
List-Help: <mailto:tiff-request@lists.maptools.org?subject=help>
List-Subscribe: <http://lists.maptools.org/mailman/listinfo/tiff>,
	<mailto:tiff-request@lists.maptools.org?subject=subscribe>
Sender: tiff-bounces@lists.maptools.org
Errors-To: tiff-bounces@lists.maptools.org
X-UIDL: 000000000023ceae.00002d0b
X-MSP-STORE: Mon, 26 May 2008 18:29:55 +0200
Status:   

Bob,

Oh I absolute agree, it's awful on MS's part.

 > It seems that the only cure is to add Windows specific code to handle
 > this specific case.

An alternative is to roll our own. Since it's only doing a linear 
search, rolling our own and taking out the use of the callback function 
would probably be faster anyhow. Also, adding an explicit linear search 
hardly adds any complexity.

Cheers,
-Edward

Bob Friesenhahn wrote:
> On Mon, 26 May 2008, Edward Lam wrote:
>>
>> In trying to compile libtiff 4.0 beta 2 on Win64 with MSVC 8, I've 
>> encountered the following warning which I think needs fixing:
>>
>> tif_dirinfo.c(508) : warning C4133: 'function' : incompatible types - 
>> from 'size_t *' to 'unsigned int *'
>>
>> The problem is that the call to lfind() on Win64 is redirected to 
>> _lfind() from search.h. For its 3rd argument, it hasn't been updated 
>> to size_t * (pointer to 64-bits) and still uses unsigned int * 
>> (pointer to 32-bits). I'm
> 
> This is just awful.  Why did Microsoft do that?
> 
> The recent libtiff updates in this area were necessary so that libtiff 
> works properly in 64-bit applications.  This is supposed to be the 
> prototype for lfind:
> 
>      void *lfind(const void *key, const void *base, size_t *nelp,
>      size_t width, int (*compar)(const void *, const void *));
> 
> It seems that the only cure is to add Windows specific code to handle 
> this specific case.
> 
> Bob
> ======================================
> Bob Friesenhahn
> bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
> GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/
> 

_______________________________________________
Tiff mailing list: Tiff@lists.maptools.org
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
