Skip to content

Commit

Permalink
Revert "Update sourcepawn submodule (#2146)"
Browse files Browse the repository at this point in the history
This reverts commit 1bcc5b8.
  • Loading branch information
psychonic committed Jun 8, 2024
1 parent 1bcc5b8 commit 0e4b1ca
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 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 (any elem1, any elem2, const any[] array, Handle hndl);
typedef SortFunc1D = function int (int elem1, int elem2, const int[] array, Handle hndl);

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

/**
* Sort comparison function for 2D array elements (sub-arrays).
Expand All @@ -121,7 +121,7 @@ native void SortCustom1D(any[] array, int array_size, SortFunc1D sortfunc, Handl
*/
typeset SortFunc2D
{
function int (any[] elem1, any[] elem2, const any[][] array, Handle hndl);
function int (int[] elem1, int[] elem2, const int[][] array, Handle hndl);
function int (char[] elem1, char[] elem2, const char[][] array, Handle hndl);
};

Expand Down
2 changes: 1 addition & 1 deletion plugins/testsuite/mock/test_sorting.sp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ void Test_Sort1D() {
AssertArrayEq("SortCustom1D Integers Ascending", intArray, {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, sizeof(intArray));

float floatArray[10] = {6.3, 7.6, 3.2, 2.1, 8.5, 5.2, 0.4, 1.7, 4.8, 8.2};
SortCustom1D(floatArray, sizeof(floatArray), Custom1DSortFloat);
SortCustom1D(view_as<any>(floatArray), sizeof(floatArray), Custom1DSortFloat);
AssertArrayEq("SortCustom1D Floats Ascending", floatArray, {0.4, 1.7, 2.1, 3.2, 4.8, 5.2, 6.3, 7.6, 8.2, 8.5}, sizeof(floatArray));
}

Expand Down
2 changes: 1 addition & 1 deletion public/amtl
2 changes: 1 addition & 1 deletion sourcepawn
Submodule sourcepawn updated 159 files

0 comments on commit 0e4b1ca

Please sign in to comment.