From eb2966c1f010a9a4789f8da4fe64ad988cd49f38 Mon Sep 17 00:00:00 2001 From: martin Date: Sun, 5 May 2019 15:48:43 +0000 Subject: [PATCH] SynEdit: fix compare function git-svn-id: trunk@61157 - --- components/synedit/syngutterlineoverview.pp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/components/synedit/syngutterlineoverview.pp b/components/synedit/syngutterlineoverview.pp index ba82e9ab5f..58a9deb4b6 100644 --- a/components/synedit/syngutterlineoverview.pp +++ b/components/synedit/syngutterlineoverview.pp @@ -30,7 +30,7 @@ uses Classes, Graphics, Controls, LCLProc, LCLType, LCLIntf, Forms, LMessages, FPCanvas, sysutils, math, SynGutterBase, SynEditTypes, LazSynEditText, SynEditTextBuffer, SynEditMarks, SynEditMiscClasses, SynEditFoldedView, - SynEditMouseCmds; + SynEditMouseCmds, LazUtilities; type TSynGutterLineOverview = class; @@ -349,9 +349,7 @@ begin if Result <> 0 then exit; Result := Column - Other.Column; if Result <> 0 then exit; - {$PUSH}{$Q-} // Overflow is allowed to occur - Result := Integer(PtrUint(self) - PtrUInt(Other)); - {$POP} + Result := ComparePointers(Pointer(self), PtrUInt(Other))); end; function TSynGutterLOvMark.CompareByLine(Other: TSynGutterLOvMark): Integer; @@ -362,9 +360,7 @@ begin if Result <> 0 then exit; Result := Priority - Other.Priority; if Result <> 0 then exit; - {$PUSH}{$Q-} // Overflow is allowed to occur - Result := Integer(PtrUint(self) - PtrUInt(Other)); - {$POP} + Result := ComparePointers(Pointer(self), PtrUInt(Other))); end; procedure TSynGutterLOvMark.DoChange; @@ -463,9 +459,7 @@ function TSynGutterLOvLineMarks.Compare(Other: TSynGutterLOvLineMarks): Integer; begin Result := PixLine - Other.PixLine; if Result <> 0 then exit; - {$PUSH}{$Q-} // Overflow is allowed to occur - Result := Integer(PtrUint(self) - PtrUInt(Other)); - {$POP} + Result := ComparePointers(Pointer(self), PtrUInt(Other))); end; constructor TSynGutterLOvLineMarks.Create;