Skip to content

Commit

Permalink
Fixed some errors on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
MCJack123 committed Jan 1, 2024
1 parent 3d88385 commit 39e38e9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/lapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

#include <stdarg.h>
#include <string.h>
#include <math.h>

#define lapi_c
#define LUA_CORE
Expand Down Expand Up @@ -370,7 +371,8 @@ LUA_API lua_Unsigned lua_tounsignedx (lua_State *L, int idx, int *isnum) {
lua_Unsigned res;
lua_Number num = nvalue(o);
//lua_number2unsigned(res, num);
res = (lua_Unsigned)floor(num);
if (num < 0) res = -(lua_Unsigned)fabs(floor(num));
else res = (lua_Unsigned)floor(num);
if (isnum) *isnum = 1;
return res;
}
Expand Down
3 changes: 2 additions & 1 deletion src/ldo.c
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ static void finishCcall (lua_State *L) {
ci->callstatus &= ~CIST_HOOKED;
switch (ci->hook) {
case LUA_HOOKCALL:
case LUA_HOOKTAILCALL:
case LUA_HOOKTAILCALL: {
/* call function since luaD_precall yielded before calling */
int n;
lua_CFunction f;
Expand All @@ -449,6 +449,7 @@ static void finishCcall (lua_State *L) {
lua_lock(L);
luaD_poscall(L, L->top - n);
break;
}
case LUA_HOOKRET:
/* retry return with hooks disabled */
L->allowhook = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/llex.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static const char *const luaX_tokens [] = {
"in", "local", "nil", "not", "or", "repeat",
"return", "then", "true", "until", "while",
"..", "...", "==", ">=", "<=", "~=", "::", "<eof>",
"<number>", "<name>", "<string>"
"<number>", "<name>", "<string>", "goto"
};


Expand Down
1 change: 1 addition & 0 deletions src/lmathlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include <time.h>

#define lmathlib_c
#define LUA_LIB
Expand Down

0 comments on commit 39e38e9

Please sign in to comment.