eris: clean up compiler warnings

This commit is contained in:
2021-12-08 13:36:46 -05:00
parent b55040665c
commit ddda9df518
3 changed files with 15 additions and 25 deletions

View File

@@ -571,24 +571,20 @@ l_noret luaG_ordererror (lua_State *L, const TValue *p1, const TValue *p2) {
}
static void addinfo (lua_State *L, const char *msg) {
CallInfo *ci = L->ci;
if (isLua(ci)) { /* is Lua code? */
char buff[LUA_IDSIZE]; /* add file:line information */
int line = currentline(ci);
TString *src = ci_func(ci)->p->source;
if (src)
luaO_chunkid(buff, getstr(src), LUA_IDSIZE);
else { /* no source available; use "?" instead */
buff[0] = '?'; buff[1] = '\0';
}
luaO_pushfstring(L, "%s:%d: %s", buff, line, msg);
}
}
static void no_addinfo (lua_State *L, const char *msg) {
// do nothing.
}
// static void addinfo (lua_State *L, const char *msg) {
// CallInfo *ci = L->ci;
// if (isLua(ci)) { /* is Lua code? */
// char buff[LUA_IDSIZE]; /* add file:line information */
// int line = currentline(ci);
// TString *src = ci_func(ci)->p->source;
// if (src)
// luaO_chunkid(buff, getstr(src), LUA_IDSIZE);
// else { /* no source available; use "?" instead */
// buff[0] = '?'; buff[1] = '\0';
// }
// luaO_pushfstring(L, "%s:%d: %s", buff, line, msg);
// }
// }
l_noret luaG_errormsg (lua_State *L) {
if (L->errfunc != 0) { /* is there an error handling function? */
@@ -606,7 +602,7 @@ l_noret luaG_errormsg (lua_State *L) {
l_noret luaG_runerror (lua_State *L, const char *fmt, ...) {
va_list argp;
va_start(argp, fmt);
no_addinfo(L, luaO_pushvfstring(L, fmt, argp));
// addinfo(L, luaO_pushvfstring(L, fmt, argp));
va_end(argp);
luaG_errormsg(L);
}