summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarco <marco@3ad0048d-3df7-0310-abae-a5850022a9f2>2017-06-21 14:09:01 +0000
committermarco <marco@3ad0048d-3df7-0310-abae-a5850022a9f2>2017-06-21 14:09:01 +0000
commitbcaf93d01467ac2b8b92fb145153d5f214fa1e6a (patch)
tree84e5d3b11bf32b478eb91b9fcfff1095f84cd619
parent6579465803a09e087561def025ec009ebf2d6182 (diff)
downloadfpc-bcaf93d01467ac2b8b92fb145153d5f214fa1e6a.tar.gz
--- Merging r35459 into '.':
U packages/bzip2/src/bzip2.pas U packages/bzip2/src/bzip2stream.pp --- Recording mergeinfo for merge of r35459 into '.': U . # revisions: 35459 git-svn-id: https://svn.freepascal.org/svn/fpc/branches/fixes_3_0@36560 3ad0048d-3df7-0310-abae-a5850022a9f2
-rw-r--r--packages/bzip2/src/bzip2.pas16
-rw-r--r--packages/bzip2/src/bzip2stream.pp16
2 files changed, 16 insertions, 16 deletions
diff --git a/packages/bzip2/src/bzip2.pas b/packages/bzip2/src/bzip2.pas
index cbbb62b08d..f2b21cec04 100644
--- a/packages/bzip2/src/bzip2.pas
+++ b/packages/bzip2/src/bzip2.pas
@@ -417,7 +417,7 @@ begin
end;
while es>0 do
begin
- tt^[t]:=n;
+ tt^[t]:=ntole(cardinal(n));
dec(es);
inc(t);
end;
@@ -462,7 +462,7 @@ begin
move_mtf_block;
end;
inc(cftab[seq_to_unseq[n]]);
- tt^[t]:=cardinal(seq_to_unseq[n]);
+ tt^[t]:=ntole(cardinal(seq_to_unseq[n]));
inc(t);
if t>100000*blocksize then
begin
@@ -497,9 +497,9 @@ begin
q:=p+tt_count;
while p<>q do
begin
- r:=@tt^[cftab[p^ and $ff]];
- inc(cftab[p^ and $ff]);
- r^:=r^ or a;
+ r:=@tt^[cftab[ntole(p^) and $ff]];
+ inc(cftab[ntole(p^) and $ff]);
+ r^:=r^ or ntole(a);
inc(a,256);
inc(p);
end;
@@ -567,7 +567,7 @@ procedure Tbzip2_decode_stream.new_block;
begin
if decode_block then
- nextrle:=@tt^[tt^[block_origin] shr 8]
+ nextrle:=@tt^[ntole(tt^[block_origin]) shr 8]
else
begin
error(streaderror,bzip2_endoffile);
@@ -582,7 +582,7 @@ procedure Tbzip2_decode_stream.consume_rle;inline;
begin
{ Pcardinal(nextrle)^:=Pcardinal(nextrle)^ shr 8;}
- nextrle:=@tt^[Pcardinal(nextrle)^ shr 8];
+ nextrle:=@tt^[ntole(Pcardinal(nextrle)^) shr 8];
dec(decode_available);
if decode_available=0 then
new_block;
@@ -660,7 +660,7 @@ begin
error(streaderror,bzip2_endoffile);
nextrle:=nil;
end;
- nextrle:=@tt^[tt^[block_origin] shr 8];
+ nextrle:=@tt^[ntole(tt^[block_origin]) shr 8];
end;
rle_read(bufptr,count);
end;
diff --git a/packages/bzip2/src/bzip2stream.pp b/packages/bzip2/src/bzip2stream.pp
index 19b453935e..fa02644632 100644
--- a/packages/bzip2/src/bzip2stream.pp
+++ b/packages/bzip2/src/bzip2stream.pp
@@ -426,7 +426,7 @@ begin
error(SDecodingError,bzip2_data_error);
while es>0 do
begin
- tt^[t]:=n;
+ tt^[t]:=ntole(cardinal(n));
dec(es);
inc(t);
end;
@@ -471,7 +471,7 @@ begin
move_mtf_block;
end;
inc(cftab[seq_to_unseq[n]]);
- tt^[t]:=cardinal(seq_to_unseq[n]);
+ tt^[t]:=ntole(cardinal(seq_to_unseq[n]));
inc(t);
if t>100000*blocksize then
error(SDecodingError,bzip2_data_error);
@@ -503,9 +503,9 @@ begin
q:=p+tt_count;
while p<>q do
begin
- r:=@tt^[cftab[p^ and $ff]];
- inc(cftab[p^ and $ff]);
- r^:=r^ or a;
+ r:=@tt^[cftab[ntole(p^) and $ff]];
+ inc(cftab[ntole(p^) and $ff]);
+ r^:=r^ or ntole(a);
inc(a,256);
inc(p);
end;
@@ -563,7 +563,7 @@ Function TDecompressBzip2Stream.new_block : Boolean;
begin
Result:=decode_block;
If result then
- nextrle:=@tt^[tt^[block_origin] shr 8]
+ nextrle:=@tt^[ntole(tt^[block_origin]) shr 8]
else
nextrle:=nil;
end;
@@ -575,7 +575,7 @@ Function TDecompressBzip2Stream.consume_rle : Boolean;inline;
begin
{ Pcardinal(nextrle)^:=Pcardinal(nextrle)^ shr 8;}
- nextrle:=@tt^[Pcardinal(nextrle)^ shr 8];
+ nextrle:=@tt^[ntole(Pcardinal(nextrle)^) shr 8];
dec(decode_available);
if decode_available=0 then
Result:=new_block
@@ -652,7 +652,7 @@ begin
nextrle:=nil;
error(SDecodingError,bzip2_endoffile);
end;
- nextrle:=@tt^[tt^[block_origin] shr 8];
+ nextrle:=@tt^[ntole(tt^[block_origin]) shr 8];
end;
Result:=rle_read(bufptr,count);
end;