Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed LUALIB_API from source file method bodies #235

Merged
merged 2 commits into from
Nov 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 33 additions & 33 deletions VM/src/laux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static const char* currfuncname(lua_State* L)
return debugname;
}

LUALIB_API l_noret luaL_argerrorL(lua_State* L, int narg, const char* extramsg)
l_noret luaL_argerrorL(lua_State* L, int narg, const char* extramsg)
{
const char* fname = currfuncname(L);

Expand All @@ -40,7 +40,7 @@ LUALIB_API l_noret luaL_argerrorL(lua_State* L, int narg, const char* extramsg)
luaL_error(L, "invalid argument #%d (%s)", narg, extramsg);
}

LUALIB_API l_noret luaL_typeerrorL(lua_State* L, int narg, const char* tname)
l_noret luaL_typeerrorL(lua_State* L, int narg, const char* tname)
{
const char* fname = currfuncname(L);
const TValue* obj = luaA_toobject(L, narg);
Expand All @@ -66,7 +66,7 @@ static l_noret tag_error(lua_State* L, int narg, int tag)
luaL_typeerrorL(L, narg, lua_typename(L, tag));
}

LUALIB_API void luaL_where(lua_State* L, int level)
void luaL_where(lua_State* L, int level)
{
lua_Debug ar;
if (lua_getinfo(L, level, "sl", &ar) && ar.currentline > 0)
Expand All @@ -77,7 +77,7 @@ LUALIB_API void luaL_where(lua_State* L, int level)
lua_pushliteral(L, ""); /* else, no information available... */
}

LUALIB_API l_noret luaL_errorL(lua_State* L, const char* fmt, ...)
l_noret luaL_errorL(lua_State* L, const char* fmt, ...)
{
va_list argp;
va_start(argp, fmt);
Expand All @@ -90,7 +90,7 @@ LUALIB_API l_noret luaL_errorL(lua_State* L, const char* fmt, ...)

/* }====================================================== */

LUALIB_API int luaL_checkoption(lua_State* L, int narg, const char* def, const char* const lst[])
int luaL_checkoption(lua_State* L, int narg, const char* def, const char* const lst[])
{
const char* name = (def) ? luaL_optstring(L, narg, def) : luaL_checkstring(L, narg);
int i;
Expand All @@ -101,7 +101,7 @@ LUALIB_API int luaL_checkoption(lua_State* L, int narg, const char* def, const c
luaL_argerrorL(L, narg, msg);
}

LUALIB_API int luaL_newmetatable(lua_State* L, const char* tname)
int luaL_newmetatable(lua_State* L, const char* tname)
{
lua_getfield(L, LUA_REGISTRYINDEX, tname); /* get registry.name */
if (!lua_isnil(L, -1)) /* name already in use? */
Expand All @@ -113,7 +113,7 @@ LUALIB_API int luaL_newmetatable(lua_State* L, const char* tname)
return 1;
}

LUALIB_API void* luaL_checkudata(lua_State* L, int ud, const char* tname)
void* luaL_checkudata(lua_State* L, int ud, const char* tname)
{
void* p = lua_touserdata(L, ud);
if (p != NULL)
Expand All @@ -131,33 +131,33 @@ LUALIB_API void* luaL_checkudata(lua_State* L, int ud, const char* tname)
luaL_typeerrorL(L, ud, tname); /* else error */
}

LUALIB_API void luaL_checkstack(lua_State* L, int space, const char* mes)
void luaL_checkstack(lua_State* L, int space, const char* mes)
{
if (!lua_checkstack(L, space))
luaL_error(L, "stack overflow (%s)", mes);
}

LUALIB_API void luaL_checktype(lua_State* L, int narg, int t)
void luaL_checktype(lua_State* L, int narg, int t)
{
if (lua_type(L, narg) != t)
tag_error(L, narg, t);
}

LUALIB_API void luaL_checkany(lua_State* L, int narg)
void luaL_checkany(lua_State* L, int narg)
{
if (lua_type(L, narg) == LUA_TNONE)
luaL_error(L, "missing argument #%d", narg);
}

LUALIB_API const char* luaL_checklstring(lua_State* L, int narg, size_t* len)
const char* luaL_checklstring(lua_State* L, int narg, size_t* len)
{
const char* s = lua_tolstring(L, narg, len);
if (!s)
tag_error(L, narg, LUA_TSTRING);
return s;
}

LUALIB_API const char* luaL_optlstring(lua_State* L, int narg, const char* def, size_t* len)
const char* luaL_optlstring(lua_State* L, int narg, const char* def, size_t* len)
{
if (lua_isnoneornil(L, narg))
{
Expand All @@ -169,7 +169,7 @@ LUALIB_API const char* luaL_optlstring(lua_State* L, int narg, const char* def,
return luaL_checklstring(L, narg, len);
}

LUALIB_API double luaL_checknumber(lua_State* L, int narg)
double luaL_checknumber(lua_State* L, int narg)
{
int isnum;
double d = lua_tonumberx(L, narg, &isnum);
Expand All @@ -178,12 +178,12 @@ LUALIB_API double luaL_checknumber(lua_State* L, int narg)
return d;
}

LUALIB_API double luaL_optnumber(lua_State* L, int narg, double def)
double luaL_optnumber(lua_State* L, int narg, double def)
{
return luaL_opt(L, luaL_checknumber, narg, def);
}

LUALIB_API int luaL_checkboolean(lua_State* L, int narg)
int luaL_checkboolean(lua_State* L, int narg)
{
// This checks specifically for boolean values, ignoring
// all other truthy/falsy values. If the desired result
Expand All @@ -194,12 +194,12 @@ LUALIB_API int luaL_checkboolean(lua_State* L, int narg)
return lua_toboolean(L, narg);
}

LUALIB_API int luaL_optboolean(lua_State* L, int narg, int def)
int luaL_optboolean(lua_State* L, int narg, int def)
{
return luaL_opt(L, luaL_checkboolean, narg, def);
}

LUALIB_API int luaL_checkinteger(lua_State* L, int narg)
int luaL_checkinteger(lua_State* L, int narg)
{
int isnum;
int d = lua_tointegerx(L, narg, &isnum);
Expand All @@ -208,12 +208,12 @@ LUALIB_API int luaL_checkinteger(lua_State* L, int narg)
return d;
}

LUALIB_API int luaL_optinteger(lua_State* L, int narg, int def)
int luaL_optinteger(lua_State* L, int narg, int def)
{
return luaL_opt(L, luaL_checkinteger, narg, def);
}

LUALIB_API unsigned luaL_checkunsigned(lua_State* L, int narg)
unsigned luaL_checkunsigned(lua_State* L, int narg)
{
int isnum;
unsigned d = lua_tounsignedx(L, narg, &isnum);
Expand All @@ -222,12 +222,12 @@ LUALIB_API unsigned luaL_checkunsigned(lua_State* L, int narg)
return d;
}

LUALIB_API unsigned luaL_optunsigned(lua_State* L, int narg, unsigned def)
unsigned luaL_optunsigned(lua_State* L, int narg, unsigned def)
{
return luaL_opt(L, luaL_checkunsigned, narg, def);
}

LUALIB_API int luaL_getmetafield(lua_State* L, int obj, const char* event)
int luaL_getmetafield(lua_State* L, int obj, const char* event)
{
if (!lua_getmetatable(L, obj)) /* no metatable? */
return 0;
Expand All @@ -245,7 +245,7 @@ LUALIB_API int luaL_getmetafield(lua_State* L, int obj, const char* event)
}
}

LUALIB_API int luaL_callmeta(lua_State* L, int obj, const char* event)
int luaL_callmeta(lua_State* L, int obj, const char* event)
{
obj = abs_index(L, obj);
if (!luaL_getmetafield(L, obj, event)) /* no metafield? */
Expand All @@ -263,7 +263,7 @@ static int libsize(const luaL_Reg* l)
return size;
}

LUALIB_API void luaL_register(lua_State* L, const char* libname, const luaL_Reg* l)
void luaL_register(lua_State* L, const char* libname, const luaL_Reg* l)
{
if (libname)
{
Expand All @@ -289,7 +289,7 @@ LUALIB_API void luaL_register(lua_State* L, const char* libname, const luaL_Reg*
}
}

LUALIB_API const char* luaL_findtable(lua_State* L, int idx, const char* fname, int szhint)
const char* luaL_findtable(lua_State* L, int idx, const char* fname, int szhint)
{
const char* e;
lua_pushvalue(L, idx);
Expand Down Expand Up @@ -340,7 +340,7 @@ static size_t getnextbuffersize(lua_State* L, size_t currentsize, size_t desired
return newsize;
}

LUALIB_API void luaL_buffinit(lua_State* L, luaL_Buffer* B)
void luaL_buffinit(lua_State* L, luaL_Buffer* B)
{
// start with an internal buffer
B->p = B->buffer;
Expand All @@ -350,14 +350,14 @@ LUALIB_API void luaL_buffinit(lua_State* L, luaL_Buffer* B)
B->storage = nullptr;
}

LUALIB_API char* luaL_buffinitsize(lua_State* L, luaL_Buffer* B, size_t size)
char* luaL_buffinitsize(lua_State* L, luaL_Buffer* B, size_t size)
{
luaL_buffinit(L, B);
luaL_reservebuffer(B, size, -1);
return B->p;
}

LUALIB_API char* luaL_extendbuffer(luaL_Buffer* B, size_t additionalsize, int boxloc)
char* luaL_extendbuffer(luaL_Buffer* B, size_t additionalsize, int boxloc)
{
lua_State* L = B->L;

Expand Down Expand Up @@ -388,13 +388,13 @@ LUALIB_API char* luaL_extendbuffer(luaL_Buffer* B, size_t additionalsize, int bo
return B->p;
}

LUALIB_API void luaL_reservebuffer(luaL_Buffer* B, size_t size, int boxloc)
void luaL_reservebuffer(luaL_Buffer* B, size_t size, int boxloc)
{
if (size_t(B->end - B->p) < size)
luaL_extendbuffer(B, size - (B->end - B->p), boxloc);
}

LUALIB_API void luaL_addlstring(luaL_Buffer* B, const char* s, size_t len)
void luaL_addlstring(luaL_Buffer* B, const char* s, size_t len)
{
if (size_t(B->end - B->p) < len)
luaL_extendbuffer(B, len - (B->end - B->p), -1);
Expand All @@ -403,7 +403,7 @@ LUALIB_API void luaL_addlstring(luaL_Buffer* B, const char* s, size_t len)
B->p += len;
}

LUALIB_API void luaL_addvalue(luaL_Buffer* B)
void luaL_addvalue(luaL_Buffer* B)
{
lua_State* L = B->L;

Expand All @@ -420,7 +420,7 @@ LUALIB_API void luaL_addvalue(luaL_Buffer* B)
}
}

LUALIB_API void luaL_pushresult(luaL_Buffer* B)
void luaL_pushresult(luaL_Buffer* B)
{
lua_State* L = B->L;

Expand All @@ -444,15 +444,15 @@ LUALIB_API void luaL_pushresult(luaL_Buffer* B)
}
}

LUALIB_API void luaL_pushresultsize(luaL_Buffer* B, size_t size)
void luaL_pushresultsize(luaL_Buffer* B, size_t size)
{
B->p += size;
luaL_pushresult(B);
}

/* }====================================================== */

LUALIB_API const char* luaL_tolstring(lua_State* L, int idx, size_t* len)
const char* luaL_tolstring(lua_State* L, int idx, size_t* len)
{
if (luaL_callmeta(L, idx, "__tostring")) /* is there a metafield? */
{
Expand Down
2 changes: 1 addition & 1 deletion VM/src/lbaselib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ static void auxopen(lua_State* L, const char* name, lua_CFunction f, lua_CFuncti
lua_setfield(L, -2, name);
}

LUALIB_API int luaopen_base(lua_State* L)
int luaopen_base(lua_State* L)
{
/* set global _G */
lua_pushvalue(L, LUA_GLOBALSINDEX);
Expand Down
2 changes: 1 addition & 1 deletion VM/src/lbitlib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ static const luaL_Reg bitlib[] = {
{NULL, NULL},
};

LUALIB_API int luaopen_bit32(lua_State* L)
int luaopen_bit32(lua_State* L)
{
luaL_register(L, LUA_BITLIBNAME, bitlib);

Expand Down
2 changes: 1 addition & 1 deletion VM/src/lcorolib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ static const luaL_Reg co_funcs[] = {
{NULL, NULL},
};

LUALIB_API int luaopen_coroutine(lua_State* L)
int luaopen_coroutine(lua_State* L)
{
luaL_register(L, LUA_COLIBNAME, co_funcs);

Expand Down
2 changes: 1 addition & 1 deletion VM/src/ldblib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ static const luaL_Reg dblib[] = {
{NULL, NULL},
};

LUALIB_API int luaopen_debug(lua_State* L)
int luaopen_debug(lua_State* L)
{
luaL_register(L, LUA_DBLIBNAME, dblib);
return 1;
Expand Down
8 changes: 4 additions & 4 deletions VM/src/linit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ static const luaL_Reg lualibs[] = {
{NULL, NULL},
};

LUALIB_API void luaL_openlibs(lua_State* L)
void luaL_openlibs(lua_State* L)
{
const luaL_Reg* lib = lualibs;
for (; lib->func; lib++)
Expand All @@ -28,7 +28,7 @@ LUALIB_API void luaL_openlibs(lua_State* L)
}
}

LUALIB_API void luaL_sandbox(lua_State* L)
void luaL_sandbox(lua_State* L)
{
// set all libraries to read-only
lua_pushnil(L);
Expand All @@ -51,7 +51,7 @@ LUALIB_API void luaL_sandbox(lua_State* L)
lua_setsafeenv(L, LUA_GLOBALSINDEX, true);
}

LUALIB_API void luaL_sandboxthread(lua_State* L)
void luaL_sandboxthread(lua_State* L)
{
// create new global table that proxies reads to original table
lua_newtable(L);
Expand Down Expand Up @@ -81,7 +81,7 @@ static void* l_alloc(lua_State* L, void* ud, void* ptr, size_t osize, size_t nsi
return realloc(ptr, nsize);
}

LUALIB_API lua_State* luaL_newstate(void)
lua_State* luaL_newstate(void)
{
return lua_newstate(l_alloc, NULL);
}
2 changes: 1 addition & 1 deletion VM/src/lmathlib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ static const luaL_Reg mathlib[] = {
/*
** Open math library
*/
LUALIB_API int luaopen_math(lua_State* L)
int luaopen_math(lua_State* L)
{
uint64_t seed = uintptr_t(L);
seed ^= time(NULL);
Expand Down
2 changes: 1 addition & 1 deletion VM/src/loslib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ static const luaL_Reg syslib[] = {
{NULL, NULL},
};

LUALIB_API int luaopen_os(lua_State* L)
int luaopen_os(lua_State* L)
{
luaL_register(L, LUA_OSLIBNAME, syslib);
return 1;
Expand Down
2 changes: 1 addition & 1 deletion VM/src/lstrlib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1657,7 +1657,7 @@ static void createmetatable(lua_State* L)
/*
** Open string library
*/
LUALIB_API int luaopen_string(lua_State* L)
int luaopen_string(lua_State* L)
{
luaL_register(L, LUA_STRLIBNAME, strlib);
createmetatable(L);
Expand Down
2 changes: 1 addition & 1 deletion VM/src/ltablib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ static const luaL_Reg tab_funcs[] = {
{NULL, NULL},
};

LUALIB_API int luaopen_table(lua_State* L)
int luaopen_table(lua_State* L)
{
luaL_register(L, LUA_TABLIBNAME, tab_funcs);

Expand Down
2 changes: 1 addition & 1 deletion VM/src/lutf8lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ static const luaL_Reg funcs[] = {
{NULL, NULL},
};

LUALIB_API int luaopen_utf8(lua_State* L)
int luaopen_utf8(lua_State* L)
{
luaL_register(L, LUA_UTF8LIBNAME, funcs);

Expand Down