Change int[] to any[] for data r/w functions (#1221)

This commit is contained in:
Miikka Ylätalo 2020-07-09 12:09:13 +03:00 committed by GitHub
parent 611bad4036
commit 4e0ae0cb5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -715,7 +715,7 @@ native int GetEntPropArraySize(int entity, PropType type, const char[] prop);
* @param dataSize Size of each value in bytes (1, 2, or 4). * @param dataSize Size of each value in bytes (1, 2, or 4).
* @error Invalid entity or offset out of reasonable bounds. * @error Invalid entity or offset out of reasonable bounds.
*/ */
stock void GetEntDataArray(int entity, int offset, int[] array, int arraySize, int dataSize=4) stock void GetEntDataArray(int entity, int offset, any[] array, int arraySize, int dataSize=4)
{ {
for (int i = 0; i < arraySize; i++) for (int i = 0; i < arraySize; i++)
{ {
@ -734,7 +734,7 @@ stock void GetEntDataArray(int entity, int offset, int[] array, int arraySize, i
* @param changeState True to set the network state as changed; false otherwise. * @param changeState True to set the network state as changed; false otherwise.
* @error Invalid entity or offset out of reasonable bounds. * @error Invalid entity or offset out of reasonable bounds.
*/ */
stock void SetEntDataArray(int entity, int offset, const int[] array, int arraySize, int dataSize=4, bool changeState=false) stock void SetEntDataArray(int entity, int offset, const any[] array, int arraySize, int dataSize=4, bool changeState=false)
{ {
for (int i = 0; i < arraySize; i++) for (int i = 0; i < arraySize; i++)
{ {

View File

@ -126,7 +126,7 @@ methodmap File < Handle
// @param size Size of each element, in bytes, to be read. // @param size Size of each element, in bytes, to be read.
// Valid sizes are 1, 2, or 4. // Valid sizes are 1, 2, or 4.
// @return Number of elements read, or -1 on error. // @return Number of elements read, or -1 on error.
public native int Read(int[] items, int num_items, int size); public native int Read(any[] items, int num_items, int size);
// Reads a UTF8 or ANSI string from a file. // Reads a UTF8 or ANSI string from a file.
// //
@ -152,7 +152,7 @@ methodmap File < Handle
// @param size Size of each item in the array in bytes. // @param size Size of each item in the array in bytes.
// Valid sizes are 1, 2, or 4. // Valid sizes are 1, 2, or 4.
// @return True on success, false on error. // @return True on success, false on error.
public native bool Write(const int[] items, int num_items, int size); public native bool Write(const any[] items, int num_items, int size);
// Writes a binary string to a file. // Writes a binary string to a file.
// //
@ -361,7 +361,7 @@ native bool ReadFileLine(Handle hndl, char[] buffer, int maxlength);
* Valid sizes are 1, 2, or 4. * Valid sizes are 1, 2, or 4.
* @return Number of elements read, or -1 on error. * @return Number of elements read, or -1 on error.
*/ */
native int ReadFile(Handle hndl, int[] items, int num_items, int size); native int ReadFile(Handle hndl, any[] items, int num_items, int size);
/** /**
* Reads a UTF8 or ANSI string from a file. * Reads a UTF8 or ANSI string from a file.
@ -394,7 +394,7 @@ native int ReadFileString(Handle hndl, char[] buffer, int max_size, int read_cou
* @return True on success, false on error. * @return True on success, false on error.
* @error Invalid Handle. * @error Invalid Handle.
*/ */
native bool WriteFile(Handle hndl, const int[] items, int num_items, int size); native bool WriteFile(Handle hndl, const any[] items, int num_items, int size);
/** /**
* Writes a binary string to a file. * Writes a binary string to a file.