From a2bfc5e9f4c66db6a29810c064b981d772aefb2a Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Sun, 9 Nov 2008 16:06:45 +0100 Subject: Port CRC32 and MD5 functions to standard FreePascal RTL Added compat dir for Kylix compatibility --- UCore.pas | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'UCore.pas') diff --git a/UCore.pas b/UCore.pas index 86e896b..de62e19 100644 --- a/UCore.pas +++ b/UCore.pas @@ -241,7 +241,8 @@ var LeftLocalEngine, RightLocalEngine: TPanelEngine; implementation (********************************************************************************************************************************) uses SysUtils, DateUtils, StrUtils, UConfig, UDirDelete, UOverwrite, ULocale, - UNewDir, UFileAssoc, USymlink, UCoreClasses, URemoteWait, UMain, UGnome; + UNewDir, UFileAssoc, USymlink, UCoreClasses, URemoteWait, UMain, UGnome, + crc; @@ -1586,7 +1587,7 @@ begin Exit; end; - CurrentCRC := $FFFFFFFF; + CurrentCRC := 0; SizeDone := 0; PrivateCancel := False; if ParamBool1 then begin @@ -1624,7 +1625,7 @@ begin end; if not (Cancelled or PrivateCancel) then if HasFinalCRC then begin - if not CurrentCRC = ParamLongWord1 + if CurrentCRC = ParamLongWord1 then ShowMessageBox(Format(LANGMergeOfSSucceeded, [StrToUTF8(ExtractFileName(TargetFinalName))]), [mbOK], mbInfo, mbNone, mbOK) else ShowMessageBox(LANGWarningCreatedFileFailsCRCCheck, [mbOK], mbWarning, mbNone, mbOK); end else ShowMessageBox(Format(LANGMergeOfSSucceeded_NoCRCFileAvailable, [StrToUTF8(ExtractFileName(TargetFinalName))]), [mbOK], mbInfo, mbNone, mbOK); @@ -1767,7 +1768,7 @@ begin end; FileSize := Stat^.Size; SizeDone := 0; - FileCRC := $FFFFFFFF; + FileCRC := 0; List := TList.Create; try @@ -1877,7 +1878,7 @@ begin TDF := Engine.GetFileSystemFree(FilePath); if (TDF < 512) and (not NewDiskQuestion) then Break; until (TDF >= 512) or PrivateCancel or Cancelled; - if WriteCRCFile(Engine, IncludeTrailingPathDelimiter(FilePath) + FileName, OriginalFName, SizeDone, not FileCRC) + if WriteCRCFile(Engine, IncludeTrailingPathDelimiter(FilePath) + FileName, OriginalFName, SizeDone, FileCRC) then ShowMessageBox(Format(LANGSplitOfSSucceeded, [StrToUTF8(OriginalFName)]), [mbOK], mbInfo, mbNone, mbOK) else begin FCancelMessage := Format(LANGSplitOfSFailed, [StrToUTF8(OriginalFName)]); -- cgit v1.2.3