[Shapelib] Re: Suggested patch for shplib

ANDY CANFIELD andy_canfield at hotmail.com
Tue Nov 23 17:48:27 EST 2004


long long is not cross platform as far as I know. If you are using Win32 
then it maps to __int64 but it would make the library non-portable between 
systems. long long is ANSI/ISO C legal as of C99 but not all platforms 
implement it. I would stay away from it just because I hate #ifndef stuff 
clutering up libraries. However it is ISO/IEC 9899:1999 ( C99 ) legal so 
it's really up to you Frank if you want to put it in or not. But if we start 
saying that shapelib can use anything from C99 then that really opens up a 
whole ball of wax for things that many peoples compiler's simply don't 
support at this time. My vote is to leave it as is until more compilers and 
systems support that standard. For now casting works just fine on systems 
that support that data type.

>From: Frank Warmerdam <warmerdam at pobox.com>
>Reply-To: Shapelib Development <shapelib at maptools.org>
>To: Paul Balomiri <paulbalomiri at gmail.com>
>CC: shapelib <shapelib at maptools.org>
>Subject: [Shapelib] Re: Suggested patch for shplib
>Date: Mon, 22 Nov 2004 23:47:29 -0500
>
>Paul Balomiri wrote:
>>Hi,
>>I'm currently working on a trafic analyzis software using your
>>Software. You have written a great Library!  I would strongly suggest
>>to add the function DBFReadLongLongAttribute() as a long long is as
>>long as double, and People could need it. In My case Teleatlas has a
>>15 digits street  Network-ID, which I couldn't read without static
>>casts.
>>
>>
>>I supply you 2 patchfiles for the header and the C File, and hope that
>>you integrate them into your next build ...
>
>Paul,
>
>My concern with this method is that it depends on the "long long" type.
>I have been trying to keep Shapelib very basic in terms of system 
>requirements
>and I am not clear on how universal "long long" is on different operating
>systems. Also, all the method does is call the "double" style fetch 
>function.
>Why can't folks just call DBFReadDoubleAttribute() themselves and cast to
>long long?
>
>I have taken the liberty of cc:ing this message to the shapelib mailing 
>list
>in case anyone else has an opinion.  I know that there have been people
>run into problems with integer fields to long to fit in an int.
>
>Also, if we were trying to address this type of field, I wonder if it would
>be best to define a new field type so that applications would know the 
>field
>is "very wide".
>
>Best regards,
>
>--
>---------------------------------------+--------------------------------------
>I set the clouds in motion - turn up   | Frank Warmerdam, 
>warmerdam at pobox.com
>light and sound - activate the windows | http://pobox.com/~warmerdam
>and watch the world go round - Rush    | Geospatial Programmer for Rent
>
>_______________________________________________
>Shapelib mailing list
>Shapelib at lists.maptools.org
>http://lists.maptools.org/mailman/listinfo/shapelib




More information about the Shapelib mailing list