[physfs] lzma.c msvc, etc. patch

Dennis Schridde devurandom at gmx.net
Sat Feb 2 04:53:59 EST 2008


Am Samstag, 2. Februar 2008 08:03:03 schrieb Sean Ridenour:
> Isn't casting a void pointer to an unsigned long going to create 64-bit
> portability problems? From what I understand, even on 64-bit x86 CPUs a
> long is only 32 bits wide, whereas a void pointer will be 64 bits. If true,
> there'll be data loss casting a void pointer to an unsigned long.
The length of pointers and longs is afaik set by the compiler, not the 
architecture.
But indeed, MSVC has 32bit longs and 64bit pointers.
An uintptr_t should be used instead.
(I even imagined that pointer arithmetic is completely legal in C... No idea 
about C++ though.)

enumerateFiles:
I'd have fixed the NULL file by simply doing the increment later, while 
leaving the initialisation as is (except the +1)... if(dlen > 0) file++;

--Dennis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://icculus.org/pipermail/physfs/attachments/20080202/09f23d5e/attachment.pgp>


More information about the physfs mailing list