Update spcomp and includes to latest 1.10-fork

disable warning 241: Array-based enum structs will be removed in 1.11
This commit is contained in:
BotoX
2024-06-21 06:55:55 +02:00
committed by zaCade
parent 689c4e89cf
commit 917ec936f8
72 changed files with 7755 additions and 6440 deletions
+55 -55
View File
@@ -9,7 +9,7 @@
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, version 3.0, as published by the
* Free Software Foundation.
*
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
@@ -32,7 +32,7 @@
#if defined _sorting_included
#endinput
#endinput
#endif
#define _sorting_included
@@ -41,9 +41,9 @@
*/
enum SortOrder
{
Sort_Ascending = 0, /**< Ascending order */
Sort_Descending = 1, /**< Descending order */
Sort_Random = 2 /**< Random order */
Sort_Ascending = 0, /**< Ascending order */
Sort_Descending = 1, /**< Descending order */
Sort_Random = 2 /**< Random order */
};
/**
@@ -51,35 +51,35 @@ enum SortOrder
*/
enum SortType
{
Sort_Integer = 0,
Sort_Float,
Sort_String,
Sort_Integer = 0,
Sort_Float,
Sort_String
};
/**
* Sorts an array of integers.
*
* @param array Array of integers to sort in-place.
* @param array_size Size of the array.
* @param order Sorting order to use.
* @param array Array of integers to sort in-place.
* @param array_size Size of the array.
* @param order Sorting order to use.
*/
native void SortIntegers(int[] array, int array_size, SortOrder order = Sort_Ascending);
/**
* Sorts an array of float point numbers.
*
* @param array Array of floating point numbers to sort in-place.
* @param array_size Size of the array.
* @param order Sorting order to use.
* @param array Array of floating point numbers to sort in-place.
* @param array_size Size of the array.
* @param order Sorting order to use.
*/
native void SortFloats(float[] array, int array_size, SortOrder order = Sort_Ascending);
/**
* Sorts an array of strings.
*
* @param array Array of strings to sort in-place.
* @param array_size Size of the array.
* @param order Sorting order to use.
* @param array Array of strings to sort in-place.
* @param array_size Size of the array.
* @param order Sorting order to use.
*/
native void SortStrings(char[][] array, int array_size, SortOrder order = Sort_Ascending);
@@ -87,23 +87,23 @@ native void SortStrings(char[][] array, int array_size, SortOrder order = Sort_A
* Sort comparison function for 1D array elements.
* @note You may need to use explicit tags in order to use data properly.
*
* @param elem1 First element to compare.
* @param elem2 Second element to compare.
* @param array Array that is being sorted (order is undefined).
* @param hndl Handle optionally passed in while sorting.
* @return -1 if first should go before second
* 0 if first is equal to second
* 1 if first should go after second
* @param elem1 First element to compare.
* @param elem2 Second element to compare.
* @param array Array that is being sorted (order is undefined).
* @param hndl Handle optionally passed in while sorting.
* @return -1 if first should go before second
* 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, Handle hndl);
/**
/**
* Sorts a custom 1D array. You must pass in a comparison function.
*
* @param array Array to sort.
* @param array_size Size of the array to sort.
* @param sortfunc Sort function.
* @param hndl Optional Handle to pass through the comparison calls.
* @param array Array to sort.
* @param array_size Size of the array to sort.
* @param sortfunc Sort function.
* @param hndl Optional Handle to pass through the comparison calls.
*/
native void SortCustom1D(int[] array, int array_size, SortFunc1D sortfunc, Handle hndl=INVALID_HANDLE);
@@ -111,13 +111,13 @@ native void SortCustom1D(int[] array, int array_size, SortFunc1D sortfunc, Handl
* Sort comparison function for 2D array elements (sub-arrays).
* @note You may need to use explicit tags in order to use data properly.
*
* @param elem1 First array to compare.
* @param elem2 Second array to compare.
* @param array Array that is being sorted (order is undefined).
* @param hndl Handle optionally passed in while sorting.
* @return -1 if first should go before second
* 0 if first is equal to second
* 1 if first should go after second
* @param elem1 First array to compare.
* @param elem2 Second array to compare.
* @param array Array that is being sorted (order is undefined).
* @param hndl Handle optionally passed in while sorting.
* @return -1 if first should go before second
* 0 if first is equal to second
* 1 if first should go after second
*/
typeset SortFunc2D
{
@@ -125,22 +125,22 @@ typeset SortFunc2D
function int (char[] elem1, char[] elem2, const char[][] array, Handle hndl);
};
/**
/**
* Sorts a custom 2D array. You must pass in a comparison function.
*
* @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 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.
*/
native void SortCustom2D(any[][] array, int array_size, SortFunc2D sortfunc, Handle hndl=INVALID_HANDLE);
/**
* Sort an ADT Array. Specify the type as Integer, Float, or String.
*
* @param array Array Handle to sort
* @param order Sort order to use, same as other sorts.
* @param type Data type stored in the ADT Array
* @param array Array Handle to sort
* @param order Sort order to use, same as other sorts.
* @param type Data type stored in the ADT Array
*/
native void SortADTArray(Handle array, SortOrder order, SortType type);
@@ -149,21 +149,21 @@ native void SortADTArray(Handle array, SortOrder order, SortType type);
* indexes currently being sorted, use ADT Array functions to retrieve the
* index values and compare.
*
* @param index1 First index to compare.
* @param index2 Second index to compare.
* @param array Array that is being sorted (order is undefined).
* @param hndl Handle optionally passed in while sorting.
* @return -1 if first should go before second
* 0 if first is equal to second
* 1 if first should go after second
* @param index1 First index to compare.
* @param index2 Second index to compare.
* @param array Array that is being sorted (order is undefined).
* @param hndl Handle optionally passed in while sorting.
* @return -1 if first should go before second
* 0 if first is equal to second
* 1 if first should go after second
*/
typedef SortFuncADTArray = function int (int index1, int index2, Handle array, Handle hndl);
/**
* Custom sorts an ADT Array. You must pass in a comparison function.
*
* @param array Array Handle to sort
* @param sortfunc Sort comparison function to use
* @param hndl Optional Handle to pass through the comparison calls.
* @param array Array Handle to sort
* @param sortfunc Sort comparison function to use
* @param hndl Optional Handle to pass through the comparison calls.
*/
native void SortADTArrayCustom(Handle array, SortFuncADTArray sortfunc, Handle hndl=INVALID_HANDLE);
native void SortADTArrayCustom(Handle array, SortFuncADTArray sortfunc, Handle hndl=INVALID_HANDLE);