Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Cole committed Nov 18, 2023
1 parent 4737866 commit d2bb07f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 18 deletions.
32 changes: 16 additions & 16 deletions YSI_Data/y_sortedarray/y_sortedarray_entry.inc
Original file line number Diff line number Diff line change
Expand Up @@ -88,28 +88,28 @@ Optional plugins:

/*-------------------------------------------------------------------------*//**
* <param name="arr">The sorted array.</param>
* <param name="last">The number of elements in the sorted array.</param>
* <param name="size">The number of elements in the sorted array.</param>
* <param name="value">The value to find.</param>
* <returns>
* Does the array contain this value?
* </returns>
*//*------------------------------------------------------------------------**/

stock bool:_Sorted_Contains(arr[], last, value)
stock bool:_Sorted_Contains(arr[], size, value)
{
new
first = 0,
mid = 0;
while (first < last)
while (first < size)
{
mid = (first + last - 1) / 2;
mid = (first + size - 1) / 2;
if (arr[mid] < value)
{
first = mid + 1;
}
else if (arr[mid] > value)
{
last = mid;
size = mid;
}
else
{
Expand All @@ -122,62 +122,62 @@ stock bool:_Sorted_Contains(arr[], last, value)

/*-------------------------------------------------------------------------*//**
* <param name="arr">The sorted array.</param>
* <param name="last">The number of elements in the sorted array.</param>
* <param name="size">The number of elements in the sorted array.</param>
* <param name="value">The value to find.</param>
* <returns>
* The index at which the new value should be inserted.
* </returns>
*//*------------------------------------------------------------------------**/

stock _Sorted_FindInsert(arr[], last, value)
stock _Sorted_FindInsert(arr[], size, value)
{
new
first = 0,
mid = 0;
while (first < last)
while (first < size)
{
mid = (first + last - 1) / 2;
mid = (first + size - 1) / 2;
if (arr[mid] < value)
{
first = mid + 1;
}
else if (arr[mid] > value)
{
last = mid;
size = mid;
}
else
{
return mid;
}
}
return last;
return size;
}
#define Sorted_FindInsert SORTED_FUNC_N<Sorted_FindInsert>

/*-------------------------------------------------------------------------*//**
* <param name="arr">The sorted array.</param>
* <param name="last">The number of elements in the sorted array.</param>
* <param name="size">The number of elements in the sorted array.</param>
* <param name="value">The value to find.</param>
* <returns>
* The index of the value, or <c>-1</c> if it doesn't exist.
* </returns>
*//*------------------------------------------------------------------------**/

stock _Sorted_Find(arr[], last, value)
stock _Sorted_Find(arr[], size, value)
{
new
first = 0,
mid = 0;
while (first < last)
while (first < size)
{
mid = (first + last - 1) / 2;
mid = (first + size - 1) / 2;
if (arr[mid] < value)
{
first = mid + 1;
}
else if (arr[mid] > value)
{
last = mid;
size = mid;
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion YSI_Extra/y_bcrypt/y_bcrypt_natives.inc
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ stock BCrypt_GetPlugin()
}
else
{
Debug_Error("Neither BCrypt plugin is loaded. Load one!")
Debug_Error("Neither BCrypt plugin is loaded. Load one!");
plugin = 0;
}
}
Expand Down
3 changes: 2 additions & 1 deletion YSI_Server/y_decorator/y_decorator_entry.inc
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,12 @@ Optional plugins:
#include "..\..\YSI_Core\y_utils"
#include "..\y_thirdpartyinclude\y3_codeparse"

#define @decorator__(%2)(%3)%0(%1) FUNC_PARSER(DECORATOR__,ARR_CST:STR_CST:NUM_CST:RET_TAG:)(%0(%1))(%1)()()(%2)(%3)
#define @decorator__(%2)(%3)%0(%1) FUNC_PARSER(DECORATOR__,ARR_CST:STR_CST:NUM_CST:RET_TAG:EXT:)(%0(%1))(%1)()()(%2)(%3)

#define DECORATOR___ARR(%9,%9,%5,%9)%8$(%1)(%6)(%7) %8$(%1)(%6a)(%7,%5)
#define DECORATOR___STR(%9,%9,%5,%9)%8$(%1)(%6)(%7) %8$(%1)(%6s)(%7,%5)
#define DECORATOR___NUM(%9,%9,%5)%8$(%1)(%6)(%7) %8$(%1)(%6i)(%7,%5)
#define DECORATOR___EXT(%9,%9,%9)%8$(%1)(%6)(%7) %8$(%1)(%6)(%7)

#define DECORATOR___END(%0)%8$(%1)(%6)(,%7)(%2)(%3) %2:%8$(%3)(_:)(%0)(%1)(%6)(%7)
#define DECORATOR___NUL(%0)%8$()()()(%2)(%3) %2:%8$(%3)(_:)(%0)()()()
Expand Down

0 comments on commit d2bb07f

Please sign in to comment.