Skip to content

Commit 403d76d

Browse files
fix some compiler warning
example that variable Result is not defined or nothing inside except..end
1 parent 2f137bc commit 403d76d

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

source/code/main.pas

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1528,6 +1528,7 @@ procedure TFormTrackerModify.FormDropFiles(Sender: TObject;
15281528
MemoNewTrackers.Append(UTF8Trim(TrackerFileNameStringList.Text));
15291529
except
15301530
//supress any error in loading the file
1531+
FileNameOrDirStr := FileNameOrDirStr;
15311532
end;
15321533
end;
15331534

source/code/ngosang_trackerslist.pas

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ function TngosangTrackerList.DownloadTracker(ngosang_List: Tngosang_List): TStri
9595

9696
except
9797
//No OpenSSL or web server is down
98+
FTRackerList[ngosang_List].Clear;
9899
end;
99100

100101
Result := FTrackerList[ngosang_List];

source/code/torrent_miscellaneous.pas

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,11 @@ function ByteSizeToBiggerSizeFormatStr(ByteSize: int64): string;
246246
Result := Format('%0.2f MiB', [ByteSize / (1024 * 1024)])
247247
else
248248
if ByteSize >= (1024) then
249-
Result := Format('%0.2f KiB', [ByteSize / 1024]);
250-
Result := Result + Format(' (%d Bytes)', [ByteSize]);
249+
Result := Format('%0.2f KiB', [ByteSize / 1024])
250+
else
251+
Result := '';
252+
253+
Result := Result + Format(' (%d Bytes)', [ByteSize]);
251254
end;
252255

253256

@@ -629,11 +632,11 @@ function ConsoleModeDecodeParameter(out FileNameOrDirStr: UTF8String;
629632
-U3 "path_to_folder" -SAC -SOURCE "ABC"
630633
}
631634

635+
Result := False;
632636
case Paramcount of
633637
0:
634638
begin
635639
TrackerList.LogStringList.Add('ERROR: There are no parameter detected.');
636-
Result := False;
637640
exit;
638641
end;
639642
1:

source/code/trackerlist_online.pas

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ function TTrackerListOnline.TrackerListOnlineStatusToString(
9090
tos_dead: Result := 'Dead';
9191
tos_unknown: Result := 'Unknown';
9292
else
93-
assert(True, 'Unknown TTrackerListOnlineStatus')
93+
begin
94+
Result := '';
95+
assert(True, 'Unknown TTrackerListOnlineStatus')
96+
end;
9497
end;
9598
end;
9699

0 commit comments

Comments
 (0)