Skip to content

Commit

Permalink
fixed some Delphi 10.3+ warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnaud Bouchez committed Apr 23, 2021
1 parent 7644bd6 commit 28086b3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/core/mormot.core.zip.pas
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ TZipReadEntry = record
local: PLocalFileHeader;
/// offset to the local file header in the .zip archive
// - use TLocalFileHeader.DataSeek to load and seek the stream
localoffs: Int64;
localoffs: QWord;
/// name of the file inside the .zip archive
// - not ASCIIZ: length = dir^.fileInfo.nameLen
storedName: PAnsiChar;
Expand All @@ -382,7 +382,7 @@ TZipReadEntry = record
TZipRead = class
private
fSource: TStream; // if .zip is a file bigger than 1MB
fSourceOffset: Int64; // where the .zip start in fSource (if appended)
fSourceOffset: QWord; // where the .zip start in fSource (if appended)
fSourceBuffer: RawByteString; // last 1MB of fSource (central dir)
fCentralDirectoryOffset: Int64;
fCentralDirectoryFirstFile: PFileHeader;
Expand Down Expand Up @@ -1346,7 +1346,7 @@ constructor TZipWrite.CreateFrom(const aFileName: TFileName; WorkingMem: QWord;
if tmp = '' then
SetString(tmp, nil, 1 shl 20);
len := info.f64.zzipSize;
readpos := s^.localoffs + info.localfileheadersize;
readpos := Int64(s^.localoffs) + info.localfileheadersize;
repeat
FileSeek64(h, readpos, soFromBeginning);
read := length(tmp);
Expand Down Expand Up @@ -1376,7 +1376,7 @@ constructor TZipWrite.CreateFrom(const aFileName: TFileName; WorkingMem: QWord;
dec(d^.h64.size, SizeOf(d^.h64.offset));
end;
SetString(d^.intName, s^.storedName, d^.h32.fileInfo.nameLen);
inc(writepos, info.localfileheadersize + info.f64.zzipSize);
inc(writepos, info.localfileheadersize + Int64(info.f64.zzipSize));
end;
inc(Count);
inc(d);
Expand Down Expand Up @@ -1972,7 +1972,7 @@ constructor TZipRead.Create(BufZip: PByteArray; Size: PtrInt; Offset: Int64);
if e^.localoffs >= Offset then
begin
// can unzip directly from existing memory buffer
e^.local := @BufZip[e^.localoffs - Offset];
e^.local := @BufZip[Int64(e^.localoffs) - Offset];
with e^.local^.fileInfo do
if flags and FLAG_DATADESCRIPTOR <> 0 then
// crc+sizes in "data descriptor" -> call RetrieveFileInfo()
Expand Down Expand Up @@ -2055,7 +2055,7 @@ constructor TZipRead.Create(aFile: THandle;
(PCardinal(@P[i])^ + 1 = FILEAPPEND_SIGNATURE_INC) and
(PCardinal(@P[i + 12])^ + 1 = FILEAPPEND_SIGNATURE_INC) then
begin
fSourceOffset := PInt64(@P[i + 4])^;
fSourceOffset := PQWord(@P[i + 4])^;
if (fSourceOffset > 0) and
(fSourceOffset < Size - 16) then
begin
Expand All @@ -2075,7 +2075,7 @@ constructor TZipRead.Create(aFile: THandle;
for i := 0 to read - SizeOf(TLocalFileHeader) do
if IsZipStart(@P[i]) then
begin
fSourceOffset := Int64(ZipStartOffset) + i;
fSourceOffset := ZipStartOffset + Qword(i);
if Size = WorkingMem then
// small files could reuse the existing buffer
Create(@P[i], read - i, 0)
Expand Down Expand Up @@ -2569,7 +2569,7 @@ procedure InternalFileAppend(const ctxt: shortstring;
i, read: PtrInt;
Apos, Asize: Int64;
parsePEheader: boolean;
certoffs, certlenoffs, certlen, certlen2, magic: cardinal;
certoffs, certlenoffs, certlen, certlen2: cardinal;
zip: TZipWrite;
buf: array[0 .. 128 shl 10 - 1] of byte;
begin
Expand Down Expand Up @@ -2654,11 +2654,11 @@ procedure InternalFileAppend(const ctxt: shortstring;
FileAppendSignature(O, APos);
if keepdigitalsign then
begin
// the certificate length should be 64-bit aligned -> padding payload
// the certificate length should be 64-bit aligned -> pad the payload
ASize := O.Position - APos;
while ASize and 7 <> 0 do
begin
O.WriteBuffer(magic, 1);
O.WriteBuffer(buf[0], 1);
inc(ASize);
end;
// include appended content to the certificate length
Expand Down

0 comments on commit 28086b3

Please sign in to comment.