Skip to content

Commit

Permalink
Change Sort(Custom/Func)1D params from int to any
Browse files Browse the repository at this point in the history
  • Loading branch information
JoinedSenses committed May 4, 2022
1 parent bb3b736 commit 4d43cd8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugins/include/sorting.inc
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ native void SortStrings(char[][] array, int array_size, SortOrder order = Sort_A
* 0 if first is equal to second
* 1 if first should go after second
*/
typedef SortFunc1D = function int (int elem1, int elem2, const int[] array, any data);
typedef SortFunc1D = function int (any elem1, any elem2, const any[] array, any data);

/**
* Sorts a custom 1D array. You must pass in a comparison function.
Expand All @@ -105,7 +105,7 @@ typedef SortFunc1D = function int (int elem1, int elem2, const int[] array, any
* @param sortfunc Sort function.
* @param data Optional Handle or value to pass through the comparison calls.
*/
native void SortCustom1D(int[] array, int array_size, SortFunc1D sortfunc, any data=0);
native void SortCustom1D(any[] array, int array_size, SortFunc1D sortfunc, any data=0);

/**
* Sort comparison function for 2D array elements (sub-arrays).
Expand All @@ -127,7 +127,7 @@ typedef SortFunc2D = function int (any[] elem1, any[] elem2, const any[][] array
* @param array Array to sort.
* @param array_size Size of the major array to sort (first index, outermost).
* @param sortfunc Sort comparison function to use.
* @param hndl Optional Handle to pass through the comparison calls.
* @param data Optional Handle or value to pass through the comparison calls.
*/
native void SortCustom2D(any[][] array, int array_size, SortFunc2D sortfunc, any data=0);

Expand Down Expand Up @@ -160,6 +160,6 @@ typedef SortFuncADTArray = function int (int index1, int index2, Handle array, a
*
* @param array Array Handle to sort
* @param sortfunc Sort comparison function to use
* @param data Optional Handle or data to pass through the comparison calls.
* @param data Optional Handle or value to pass through the comparison calls.
*/
native void SortADTArrayCustom(Handle array, SortFuncADTArray sortfunc, any data=0);

0 comments on commit 4d43cd8

Please sign in to comment.