Skip to content

Commit 54ea585

Browse files
committed
remobjects#272: Delphi 12.2 Warning: W1075 Overloading a similar index type by declaring an array property 'Items'
1 parent 9ae24fd commit 54ea585

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Source/uPSUtils.pas

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,8 @@ TPSList = class(TObject)
351351

352352
FCheckCount: Cardinal;
353353
private
354-
function GetItem(Nr: Cardinal): Pointer;
355-
procedure SetItem(Nr: Cardinal; P: Pointer);
354+
function GetItem(Nr: Longint): Pointer;
355+
procedure SetItem(Nr: Longint; P: Pointer);
356356
public
357357
{$IFNDEF PS_NOSMARTLIST}
358358

@@ -369,7 +369,7 @@ TPSList = class(TObject)
369369

370370
property Count: Cardinal read FCount;
371371

372-
property Items[nr: Cardinal]: Pointer read GetItem write SetItem; default;
372+
property Items[nr: Longint]: Pointer read GetItem write SetItem; default;
373373

374374
function Add(P: Pointer): Longint;
375375

@@ -921,17 +921,17 @@ destructor TPSList.Destroy;
921921
end;
922922
//-------------------------------------------------------------------
923923

924-
procedure TPSList.SetItem(Nr: Cardinal; P: Pointer);
924+
procedure TPSList.SetItem(Nr: Longint; P: Pointer);
925925
begin
926-
if (FCount = 0) or (Nr >= FCount) then
926+
if (FCount = 0) or (Cardinal(Nr) >= FCount) then
927927
Exit;
928928
FData[Nr] := P;
929929
end;
930930
//-------------------------------------------------------------------
931931

932-
function TPSList.GetItem(Nr: Cardinal): Pointer; {12}
932+
function TPSList.GetItem(Nr: Longint): Pointer; {12}
933933
begin
934-
if Nr < FCount then
934+
if Cardinal(Nr) < FCount then
935935
GetItem := FData[Nr]
936936
else
937937
GetItem := nil;

0 commit comments

Comments
 (0)