From: <ah...@us...> - 2013-05-23 16:54:36
|
Revision: 13515 http://jvcl.svn.sourceforge.net/jvcl/?rev=13515&view=rev Author: ahuser Date: 2013-05-23 16:54:27 +0000 (Thu, 23 May 2013) Log Message: ----------- Mantis #6142: TJvInterpreterIdentifierList.Sort not work in delphi x64 Modified Paths: -------------- trunk/jvcl/run/JvInterpreter.pas Modified: trunk/jvcl/run/JvInterpreter.pas =================================================================== --- trunk/jvcl/run/JvInterpreter.pas 2013-05-21 15:59:14 UTC (rev 13514) +++ trunk/jvcl/run/JvInterpreter.pas 2013-05-23 16:54:27 UTC (rev 13515) @@ -2870,22 +2870,21 @@ Index := L; end; -procedure TJvInterpreterIdentifierList.Sort(Compare: TListSortCompare = nil); +function SortIdentifier(Item1, Item2: Pointer): Integer; +begin + { function AnsiStrIComp about 30% faster than AnsiCompareText } + { Result := AnsiCompareText(TJvInterpreterIdentifier(Item1).Identifier, + TJvInterpreterIdentifier(Item2).Identifier); } + Result := AnsiStrIComp(PChar(TJvInterpreterIdentifier(Item1).Identifier), + PChar(TJvInterpreterIdentifier(Item2).Identifier)); +end; - function SortIdentifier(Item1, Item2: Pointer): Integer; - begin - { function AnsiStrIComp about 30% faster than AnsiCompareText } - { Result := AnsiCompareText(TJvInterpreterIdentifier(Item1).Identifier, - TJvInterpreterIdentifier(Item2).Identifier); } - Result := AnsiStrIComp(PChar(TJvInterpreterIdentifier(Item1).Identifier), - PChar(TJvInterpreterIdentifier(Item2).Identifier)); - end; - +procedure TJvInterpreterIdentifierList.Sort(Compare: TListSortCompare = nil); begin if Assigned(Compare) then inherited Sort(Compare) else - inherited Sort(TListSortCompare(@SortIdentifier)); + inherited Sort(SortIdentifier); end; function TJvInterpreterIdentifierList.IndexOf(const UnitName, Identifier: string): TJvInterpreterIdentifier; @@ -8205,7 +8204,7 @@ //=== { TJvInterpreterMethodList } =========================================== -function SortIdentifier(Item1, Item2: Pointer): Integer; +function SortMethodIdentifier(Item1, Item2: Pointer): Integer; begin { function AnsiStrIComp about 30% faster than AnsiCompareText } { Result := AnsiCompareText(TJvInterpreterIdentifier(Item1).Identifier, @@ -8225,7 +8224,7 @@ procedure TJvInterpreterMethodList.Sort(Compare: TListSortCompare); begin - inherited Sort(SortIdentifier); + inherited Sort(SortMethodIdentifier); end; //=== { TJvInterpreterRecord } =============================================== This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |