Kaynağa Gözat

Remove no-longer-needed Int64 casts when accessing TFile.Size.

Jordan Russell 2 ay önce
ebeveyn
işleme
e6659b27ea

+ 2 - 2
Projects/ISSigTool.dpr

@@ -176,7 +176,7 @@ begin
   var FileHash: TSHA256Digest;
   const F = TFile.Create(AFilename, fdOpenExisting, faRead, fsRead);
   try
-    FileSize := Int64(F.Size);
+    FileSize := F.Size;
     FileHash := CalcFileHash(F);
   finally
     F.Free;
@@ -258,7 +258,7 @@ begin
 
   const F = TFile.Create(AFilename, fdOpenExisting, faRead, fsRead);
   try
-    if Int64(F.Size) <> ExpectedFileSize then begin
+    if F.Size <> ExpectedFileSize then begin
       PrintUnlessQuiet('WRONGSIZE (File size is incorrect)');
       Exit;
     end;

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

@@ -7243,7 +7243,7 @@ var
               AbortCompileFmt(SCompilerCompressInternalError, ['Unexpected ISSigVerifySignature result']);
             if (ExpectedFileName <> '') and not PathSame(PathExtractName(FileLocationEntryFilenames[I]), ExpectedFileName) then
               VerificationError(veFileNameIncorrect, FileLocationEntryFilenames[I]);
-            if Int64(SourceFile.Size) <> ExpectedFileSize then
+            if SourceFile.Size <> ExpectedFileSize then
               VerificationError(veFileSizeIncorrect, FileLocationEntryFilenames[I]);
             { ExpectedFileHash checked below after compression }
           end;

+ 2 - 2
Projects/Src/Setup.Install.pas

@@ -348,7 +348,7 @@ begin
     VerificationError(veFileNameIncorrect);
   var FileSize: Int64;
   if SourceF <> nil then
-    FileSize := Int64(SourceF.Size)
+    FileSize := SourceF.Size
   else
     FileSize := SourceFS.Size;
   if FileSize <> ExpectedFileSize then
@@ -3943,7 +3943,7 @@ begin
         const DestF = TFile.Create(DestFile, fdOpenExisting, faRead, fsReadWrite);
         try
           { Not checking ExistingFileName because we can't be sure what the original filename was }
-          if (Int64(DestF.Size) = ExistingFileSize) and
+          if (DestF.Size = ExistingFileSize) and
              (SHA256DigestsEqual(GetSHA256OfFile(DestF), ExistingFileHash)) then begin
             Log('  File already downloaded.');
             Result := 0;