AWARE SYSTEMS
TIFF and LibTiff Mail List Archive

Thread

2007.08.24 21:08 "[Tiff] A few libtiff4 changes", by Frank Warmerdam
2007.09.12 15:01 "Re: [Tiff] SIZEOF_UNSIGNED_LONG", by Frank Warmerdam
2007.09.12 03:36 "[Tiff] SIZEOF_UNSIGNED_LONG", by Frank Warmerdam
2007.09.12 12:59 "Re: [Tiff] SIZEOF_UNSIGNED_LONG", by Edward Lam
2007.09.12 13:04 "Re: [Tiff] SIZEOF_UNSIGNED_LONG", by Edward Lam
2007.09.12 13:56 "Re: [Tiff] SIZEOF_UNSIGNED_LONG", by Frank Warmerdam
2007.09.12 14:09 "Re: [Tiff] SIZEOF_UNSIGNED_LONG", by Edward Lam
2007.09.12 15:09 "Re: [Tiff] SIZEOF_UNSIGNED_LONG", by Edward Lam
2007.09.12 15:02 "Re: [Tiff] SIZEOF_UNSIGNED_LONG", by Bob Friesenhahn
2007.09.19 13:23 "[Tiff] New Beta Cut?", by Frank Warmerdam
2007.09.19 14:25 "Re: [Tiff] New Beta Cut?", by Bob Friesenhahn
2007.09.20 22:15 "Re: [Tiff] New Beta Cut?", by Andrey Kiselev
2007.09.20 21:03 "[Tiff] libtiff4, and the size of STRIPOFFSETs and TILEOFFSETs", by Frank Warmerdam
2007.09.20 22:20 "Re: [Tiff] libtiff4, and the size of STRIPOFFSETs and TILEOFFSETs", by Andrey Kiselev
2007.09.21 17:46 "Re: [Tiff] libtiff4, and the size of STRIPOFFSETs and TILEOFFSETs", by Joris Van Damme
2007.10.04 15:05 "Re: [Tiff] libtiff4, and the size of STRIPOFFSETs and TILEOFFSETs", by Frank Warmerdam
2007.10.05 05:45 "Re: [Tiff] libtiff4, and the size of STRIPOFFSETs and TILEOFFSETs", by Joris Van Damme
2007.10.18 14:47 "Re: [Tiff] linking in MS Visual Studio 2005", by Jason Tillett
2007.10.18 13:54 "[Tiff] linking in MS Visual Studio 2005", by Jason Tillett
2007.10.18 14:37 "Re: [Tiff] linking in MS Visual Studio 2005", by Frank Warmerdam

2007.09.12 15:02 "Re: [Tiff] SIZEOF_UNSIGNED_LONG", by Bob Friesenhahn

On Tue, 11 Sep 2007, Frank Warmerdam wrote:

The concern I have is that this code defaults to assuming 32bit if the macro is not defined, and it produces incorrect results if the unsigned long is actually 64bit.

I wonder if we should either:

I have yet to encounter a modern system where sizeof(long) is not 8 or 4. I notice that each macro is used exactly once. It does not seem bad to me to have the macro incorporate both cases with a "runtime" test for sizeof(long). Since sizeof(long) will be a constant, 1/2 of the code will be dead code and the compiler can simply throw it away. Even if it does not throw the unused code away there should be practically no runtime overhead if it does perform the test.

There are probably more imaginative approaches than I describe above but I leave those approaches for people with an imagination. It seems that the implementation of FILL and ZERO are a form of optimization for decisions which are not very hard (most are cp[n-1]=value), could be implemented quite differently, and might actually run faster without the apparent optimization.

Bob
======================================
Bob Friesenhahn
bfriesen@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer, http://www.GraphicsMagick.org/