IDE: SynEdit: fix potential rangecheck in compare function

git-svn-id: trunk@61151 -
This commit is contained in:
martin 2019-05-05 15:30:02 +00:00
parent 4d8827642a
commit 1e08f29dd0
2 changed files with 3 additions and 3 deletions

View File

@ -75,7 +75,7 @@ var
begin
Form1 := TNonFormProxyDesignerForm(Data1) as INonFormDesigner;
Form2 := TNonFormProxyDesignerForm(Data2) as INonFormDesigner;
Result := PtrInt(Form1.LookupRoot) - PtrInt(Form2.LookupRoot);
Result := Integer(PtrInt(Form1.LookupRoot) - PtrInt(Form2.LookupRoot));
end;
function CompareLookupRootAndNonFormDesignerForm(Key, Data: Pointer): integer;
@ -85,7 +85,7 @@ var
begin
LookupRoot := TComponent(Key);
Form := TNonFormProxyDesignerForm(Data) as INonFormDesigner;
Result := PtrInt(LookupRoot) - PtrInt(Form.LookupRoot);
Result := Integer(PtrInt(LookupRoot) - PtrInt(Form.LookupRoot));
end;
{ TCustomNonFormDesignerForm }

View File

@ -437,7 +437,7 @@ end;
function TSourceMark.Compare(OtherMark: TSourceMark): integer;
begin
Result:=PtrInt(SourceEditorID)-PtrInt(OtherMark.SourceEditorID);
Result:=ComparePointers(Pointer(SourceEditorID), Pointer(OtherMark.SourceEditorID));
if Result<>0 then exit;
Result:=Line-OtherMark.Line;
if Result<>0 then exit;