[fpc-pascal] LZMA Algorithm fails on 64bit
Matthias Klumpp
matthias at nlinux.org
Sat Jan 23 15:12:45 CET 2010
On Sat, 23 Jan 2010 14:19:23 +0100, Jonas Maebe <jonas.maebe at elis.ugent.be>
wrote:
>> Does anyone know why the code fails to work?
>
> Not really, but at least the following is will be evaluated differently
on
> 32 and 64 bit platforms:
>
> [...]
> v is a byte, i is a longint (integer in Delphi mode). Outsize is an
int64.
>
> On a 32 bit platform, "v shl (8 * i)" will be evaluated as 32 bit. This
> means that the upper 32 bits of the result of that expression will be
> discarded before the "or" operation is performed. On a 64 bit platform,
> that entire expression will be evaluated using 64 bit arithmetic.
>
Hi!
Maybe the is the reason why it fails, cause the compression does not do
operations like this. How do I have to change the expression to make it
work on 32bit and 64bit?
Thanks!
Matthias
More information about the fpc-pascal
mailing list