lua update to 5.1.5

Modify Rocklua towards upstream 5.1.5

Clean up some of the Rocklua implementation

Change-Id: Iac722e827899cf84f5ca004ef7ae7ddce5f7fbbe
This commit is contained in:
William Wilgus 2018-11-08 11:32:45 -05:00
parent de6618a271
commit b69faf0bcc
15 changed files with 124 additions and 105 deletions

View file

@ -199,7 +199,7 @@ LUALIB_API lua_Integer luaL_optinteger (lua_State *L, int narg,
return luaL_opt(L, luaL_checkinteger, narg, def);
}
/* ROCKLUA ADDED */
LUALIB_API int luaL_checkboolean (lua_State *L, int narg) {
int b = lua_toboolean(L, narg);
if( b == 0 && !lua_isboolean(L, narg))
@ -207,7 +207,7 @@ LUALIB_API int luaL_checkboolean (lua_State *L, int narg) {
return b;
}
/* ROCKLUA ADDED */
LUALIB_API int luaL_optboolean (lua_State *L, int narg, int def) {
return luaL_opt(L, luaL_checkboolean, narg, def);
}
@ -538,7 +538,7 @@ typedef struct LoadF {
char buff[LUAL_BUFFERSIZE];
} LoadF;
static const char *getF(lua_State *L, void *ud, size_t *size) {
static const char *getF (lua_State *L, void *ud, size_t *size) {
LoadF *lf = (LoadF *)ud;
(void)L;
if (lf->extraline) {
@ -547,7 +547,6 @@ static const char *getF(lua_State *L, void *ud, size_t *size) {
return "\n";
}
*size = rb->read(lf->f, lf->buff, LUAL_BUFFERSIZE);
if (*size <= 0) return NULL;
return (*size > 0) ? lf->buff : NULL;
}