Pārlūkot izejas kodu

* use SizeUInt instead of longint for the array indices in the quicksort
implementations. This:
1) allows sorting arrays with >4G elements on 64-bit systems
2) allows sorting arrays with up to 4G (>2G) elements on 32-bit systems
3) uses 16-bit instead of the less efficient 32-bit indices on 16-bit and
8-bit platforms

git-svn-id: trunk@41230 -

nickysn 6 gadi atpakaļ
vecāks
revīzija
bea9961d2d
1 mainītis faili ar 8 papildinājumiem un 8 dzēšanām
  1. 8 8
      rtl/inc/sortbase.pp

+ 8 - 8
rtl/inc/sortbase.pp

@@ -64,10 +64,10 @@ var
 
 implementation
 
-Procedure QuickSort_PtrList_NoContext(ItemPtrs: PPointer; L, R : Longint;
+Procedure QuickSort_PtrList_NoContext(ItemPtrs: PPointer; L, R : SizeUInt;
                                       Comparer: TListSortComparer_NoContext);
 var
-  I, J, PivotIdx : Longint;
+  I, J, PivotIdx : SizeUInt;
   P, Q : Pointer;
 begin
  repeat
@@ -132,9 +132,9 @@ end;
 
 procedure QuickSort_PtrList_Context(ItemPtrs: PPointer; ItemCount: SizeUInt; Comparer: TListSortComparer_Context; Context: Pointer);
 
-  procedure QuickSort(L, R : Longint);
+  procedure QuickSort(L, R : SizeUInt);
   var
-    I, J, PivotIdx : Longint;
+    I, J, PivotIdx : SizeUInt;
     P, Q : Pointer;
   begin
     repeat
@@ -201,9 +201,9 @@ procedure QuickSort_ItemList_Context(Items: Pointer; ItemCount, ItemSize: SizeUI
 var
   TempBuf: Pointer;
 
-  procedure QuickSort(L, R : Longint);
+  procedure QuickSort(L, R : SizeUInt);
   var
-    I, J, PivotIdx : Longint;
+    I, J, PivotIdx : SizeUInt;
     P : Pointer;
   begin
     repeat
@@ -279,9 +279,9 @@ procedure QuickSort_ItemList_CustomItemExchanger_Context(
                 Exchanger: TListSortCustomItemExchanger_Context;
                 Context: Pointer);
 
-  procedure QuickSort(L, R : Longint);
+  procedure QuickSort(L, R : SizeUInt);
   var
-    I, J, PivotIdx : Longint;
+    I, J, PivotIdx : SizeUInt;
     P : Pointer;
   begin
     repeat