mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Replace some trivial uses of fprintf() with fputs.
This commit is contained in:
parent
c0efa6f00e
commit
774280d9c1
@ -314,8 +314,11 @@ LUALIB_API int luaL_loadstring(lua_State *L, const char *s)
|
|||||||
|
|
||||||
static int panic(lua_State *L)
|
static int panic(lua_State *L)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "PANIC: unprotected error in call to Lua API (%s)\n",
|
const char *s = lua_tostring(L, -1);
|
||||||
lua_tostring(L, -1));
|
fputs("PANIC: unprotected error in call to Lua API (", stderr);
|
||||||
|
fputs(s ? s : "?", stderr);
|
||||||
|
fputc(')', stderr); fputc('\n', stderr);
|
||||||
|
fflush(stderr);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -366,7 +369,7 @@ LUALIB_API lua_State *luaL_newstate(void)
|
|||||||
LUA_API lua_State *lua_newstate(lua_Alloc f, void *ud)
|
LUA_API lua_State *lua_newstate(lua_Alloc f, void *ud)
|
||||||
{
|
{
|
||||||
UNUSED(f); UNUSED(ud);
|
UNUSED(f); UNUSED(ud);
|
||||||
fprintf(stderr, "Must use luaL_newstate() for 64 bit target\n");
|
fputs("Must use luaL_newstate() for 64 bit target\n", stderr);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -46,8 +46,9 @@ void lj_vmevent_call(lua_State *L, ptrdiff_t argbase)
|
|||||||
if (LJ_UNLIKELY(status)) {
|
if (LJ_UNLIKELY(status)) {
|
||||||
/* Really shouldn't use stderr here, but where else to complain? */
|
/* Really shouldn't use stderr here, but where else to complain? */
|
||||||
L->top--;
|
L->top--;
|
||||||
fprintf(stderr, "VM handler failed: %s\n",
|
fputs("VM handler failed: ", stderr);
|
||||||
tvisstr(L->top) ? strVdata(L->top) : "?");
|
fputs(tvisstr(L->top) ? strVdata(L->top) : "?", stderr);
|
||||||
|
fputc('\n', stderr);
|
||||||
}
|
}
|
||||||
hook_restore(g, oldh);
|
hook_restore(g, oldh);
|
||||||
if (g->vmevmask != VMEVENT_NOCACHE)
|
if (g->vmevmask != VMEVENT_NOCACHE)
|
||||||
|
Loading…
Reference in New Issue
Block a user