mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-18 20:39:43 +02:00
* fixed bug #14595
* small speed improvements git-svn-id: trunk@13740 -
This commit is contained in:
parent
2db72437e8
commit
5c64c75dd7
@ -1081,7 +1081,7 @@ begin
|
||||
Exit;
|
||||
end;
|
||||
// if FirstBlock is odd (1,3,5,7 etc) we have to read the even block before it first.
|
||||
if (FirstBlock <> 0) and (FirstBlock mod 2 > 0) then begin
|
||||
if FirstBlock and 1 = 1 then begin
|
||||
fStream.Position := fHeaderSuffix.Offset + fCachedEntry.ContentOffset + (ResetTable[FirstBLock-1]);
|
||||
ReadCount := ResetTable[FirstBlock] - ResetTable[FirstBlock-1];
|
||||
BlockWriteLength:=BlockSize;
|
||||
@ -1131,7 +1131,7 @@ begin
|
||||
end;
|
||||
|
||||
// if the next block is an even numbered block we have to reset the decompressor state
|
||||
if (X < LastBlock) and (X mod 2 > 0) then LZXreset(LZXState);
|
||||
if (X < LastBlock) and (X and 1 = 1) then LZXreset(LZXState);
|
||||
|
||||
end;
|
||||
FreeMem(OutBuf);
|
||||
@ -1238,7 +1238,7 @@ AChm: TChmReader;
|
||||
AIndex: Integer;
|
||||
begin
|
||||
if not FileExists(AFileName) then exit;
|
||||
AStream := TFileStream.Create(AFileName, fmOpenRead);
|
||||
AStream := TFileStream.Create(AFileName, fmOpenRead, fmShareDenyWrite);
|
||||
AChm := TChmReader.Create(AStream, True);
|
||||
AIndex := AddObject(AFileName, AChm);
|
||||
fLastChm := AChm;
|
||||
|
@ -593,7 +593,7 @@ begin
|
||||
i := bits.read(16, inpos);
|
||||
j := bits.read(16, inpos);
|
||||
end;
|
||||
pState^.intel_filesize := (i shl 16) or j; ///* or 0 if not encoded */
|
||||
pState^.intel_filesize := LongInt((i shl 16) or j); ///* or 0 if not encoded */
|
||||
pState^.header_read := 1;
|
||||
end;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user