Martijn Laan 3 months ago
parent
commit
487b78d6dc

+ 2 - 4
Projects/Src/Compiler.CompressionHandler.pas

@@ -215,10 +215,8 @@ begin
   FChunkStartOffset := FDestFile.Position.Lo - FSliceBaseOffset;
   FDestFile.WriteBuffer(ZLIBID, SizeOf(ZLIBID));
   Dec(FSliceBytesLeft, SizeOf(ZLIBID));
-  FChunkBytesRead.Hi := 0;
-  FChunkBytesRead.Lo := 0;
-  FChunkBytesWritten.Hi := 0;
-  FChunkBytesWritten.Lo := 0;
+  FChunkBytesRead := To64(0);
+  FChunkBytesWritten := To64(0);
   FInitialBytesCompressedSoFar := FCompiler.GetBytesCompressedSoFar;
 
   SelectCompressor;

+ 1 - 2
Projects/Src/Compiler.SetupCompiler.pas

@@ -5211,8 +5211,7 @@ begin
         NoCompression := False;
         NoEncryption := False;
         SolidBreak := False;
-        ExternalSize.Hi := 0;
-        ExternalSize.Lo := 0;
+        ExternalSize := To64(0);
         SortFilesByName := False;
         Sign := fsNoSetting;
 

+ 1 - 2
Projects/Src/Setup.FileExtractor.pas

@@ -256,8 +256,7 @@ begin
       FChunkLastSlice := FL.LastSlice;
       FChunkStartOffset := FL.StartOffset;
       FChunkBytesLeft := FL.ChunkCompressedSize;
-      FChunkDecompressedBytesRead.Hi := 0;
-      FChunkDecompressedBytesRead.Lo := 0;
+      FChunkDecompressedBytesRead := To64(0);
       FChunkCompressed := floChunkCompressed in FL.Flags;
       FChunkEncrypted := floChunkEncrypted in FL.Flags;
 

+ 3 - 8
Projects/Src/Setup.Install.pas

@@ -118,8 +118,7 @@ var
   CurFile: PSetupFileEntry;
   FileSize: Integer64;
 begin
-  InstallFilesSize.Hi := 0;
-  InstallFilesSize.Lo := 0;
+  InstallFilesSize := To64(0);
   AfterInstallFilesSize := InstallFilesSize;
   for N := 0 to Entries[seFile].Count-1 do begin
     CurFile := PSetupFileEntry(Entries[seFile][N]);
@@ -143,8 +142,7 @@ var
   NewMaxValue: Integer64;
 begin
   { Calculate the MaxValue for the progress meter }
-  NewMaxValue.Hi := 0;
-  NewMaxValue.Lo := 1000 * Entries[seIcon].Count;
+  NewMaxValue := To64(1000 * Entries[seIcon].Count);
   if Entries[seIni].Count <> 0 then Inc(NewMaxValue.Lo, 1000);
   if Entries[seRegistry].Count <> 0 then Inc(NewMaxValue.Lo, 1000);
   Inc6464(NewMaxValue, InstallFilesSize);
@@ -2104,7 +2102,6 @@ var
     I: Integer;
     CurFileNumber: Integer;
     CurFile: PSetupFileEntry;
-    ExternalSize: Integer64;
     SourceWildcard: String;
     ProgressBefore, ExpectedBytesLeft: Integer64;
     DisableFsRedir, FoundFiles: Boolean;
@@ -2143,9 +2140,7 @@ var
           end;
 
           if CurFile^.LocationEntry <> -1 then begin
-            ExternalSize.Hi := 0;  { not used... }
-            ExternalSize.Lo := 0;
-            ProcessFileEntry(CurFile, DisableFsRedir, '', '', FileLocationFilenames, ExternalSize,
+            ProcessFileEntry(CurFile, DisableFsRedir, '', '', FileLocationFilenames, To64(0),
               ConfirmOverwriteOverwriteAll, PromptIfOlderOverwriteAll, WarnedPerUserFonts, nil);
           end
           else begin

+ 3 - 6
Projects/Src/Setup.MainFunc.pas

@@ -1696,8 +1696,7 @@ var
   ComponentTypes: TStringList;
   I: Integer;
 begin
-  Result.Hi := 0;
-  Result.Lo := 0;
+  Result := To64(0);
   ComponentTypes := TStringList.Create();
 
   for I := 0 to Entries[seComponent].Count-1 do begin
@@ -2780,8 +2779,7 @@ var
   begin
     { Also see RecurseExternalFiles above and RecurseExternalCopyFiles in Setup.Install
       Also see RecurseExternalArchiveGetSizeOfFiles directly below }
-    Result.Hi := 0;
-    Result.Lo := 0;
+    Result := To64(0);
 
     var FindData: TWin32FindData;
     var H := FindFirstFileRedir(DisableFsRedir, SearchBaseDir + SearchSubDir + SearchWildcard, FindData);
@@ -2829,8 +2827,7 @@ var
     const RecurseSubDirs: Boolean): Integer64;
   begin
     { See above }
-    Result.Hi := 0;
-    Result.Lo := 0;
+    Result := To64(0);
 
     var FindData: TWin32FindData;
     var H := ArchiveFindFirstFileRedir(DisableFsRedir, ArchiveFilename,

+ 1 - 1
Projects/Src/Setup.ScriptFunc.pas

@@ -921,7 +921,7 @@ var
           Div64(FreeBytes, 1024*1024);
           Div64(TotalBytes, 1024*1024);
         end;
-        { Cap at 2 GB, as [Code] doesn't support 64-bit integers }
+        { Cap at 2 GB, as GetSpaceOnDisk doesn't use 64-bit integers }
         if (FreeBytes.Hi <> 0) or (FreeBytes.Lo and $80000000 <> 0) then
           FreeBytes.Lo := $7FFFFFFF;
         if (TotalBytes.Hi <> 0) or (TotalBytes.Lo and $80000000 <> 0) then

+ 2 - 3
Projects/Src/Setup.UninstallLog.pas

@@ -2,7 +2,7 @@ unit Setup.UninstallLog;
 
 {
   Inno Setup
-  Copyright (C) 1997-2024 Jordan Russell
+  Copyright (C) 1997-2025 Jordan Russell
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
 
@@ -1292,8 +1292,7 @@ var
     EndOffset, Ofs: Integer64;
     CrcHeader: TUninstallCrcHeader;
   begin
-    EndOffset.Lo := Header.EndOffset;
-    EndOffset.Hi := 0;
+    EndOffset := To64(Header.EndOffset);
     while BufLeft = 0 do begin
       Ofs := F.Position;
       Inc64(Ofs, SizeOf(CrcHeader));

+ 2 - 4
Projects/Src/Setup.WizardForm.pas

@@ -614,8 +614,7 @@ var
 begin
   ComponentEntry := PSetupComponentEntry(ComponentsList.ItemObject[Index]);
 
-  ChildrenSize.Hi := 0;
-  ChildrenSize.Lo := 0;
+  ChildrenSize := To64(0);
   if HasChildren then
     ComponentsList.EnumChildrenOf(Index, UpdateComponentSizesEnum, LongInt(@ChildrenSize));
   ComponentSize := ComponentEntry.Size;
@@ -637,8 +636,7 @@ var
   Size: Integer64;
 begin
   if shShowComponentSizes in SetupHeader.Options then begin
-    Size.Hi := 0;
-    Size.Lo := 0;
+    Size := To64(0);
     ComponentsList.EnumChildrenOf(-1, UpdateComponentSizesEnum, LongInt(@Size));
   end;
 end;

+ 2 - 6
Projects/Src/Shared.FileClass.pas

@@ -2,7 +2,7 @@ unit Shared.FileClass;
 
 {
   Inno Setup
-  Copyright (C) 1997-2024 Jordan Russell
+  Copyright (C) 1997-2025 Jordan Russell
   Portions by Martijn Laan
   For conditions of distribution and use, see LICENSE.TXT.
 
@@ -197,12 +197,8 @@ begin
 end;
 
 procedure TCustomFile.Seek(Offset: Cardinal);
-var
-  I: Integer64;
 begin
-  I.Hi := 0;
-  I.Lo := Offset;
-  Seek64(I);
+  Seek64(To64(Offset));
 end;
 
 procedure TCustomFile.WriteAnsiString(const S: AnsiString);

+ 1 - 2
Projects/Src/Shared.Int64Em.pas

@@ -244,8 +244,7 @@ begin
 
   if (StartIndex > Len) or (S[StartIndex] = '_') then
     Exit;
-  V.Lo := 0;
-  V.Hi := 0;
+  V := To64(0);
   for I := StartIndex to Len do begin
     C := UpCase(S[I]);
     case C of