mirror of
https://github.com/lua/lua
synced 2024-11-22 21:01:26 +03:00
avoid warnings about exit; return
This commit is contained in:
parent
8998032f66
commit
9cb0607f6f
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lauxlib.c,v 1.172 2007/08/10 12:56:02 roberto Exp roberto $
|
** $Id: lauxlib.c,v 1.173 2007/09/05 17:17:39 roberto Exp roberto $
|
||||||
** Auxiliary functions for building Lua libraries
|
** Auxiliary functions for building Lua libraries
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -661,8 +661,7 @@ static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) {
|
|||||||
static int panic (lua_State *L) {
|
static int panic (lua_State *L) {
|
||||||
fprintf(stderr, "PANIC: unprotected error in call to Lua API (%s)\n",
|
fprintf(stderr, "PANIC: unprotected error in call to Lua API (%s)\n",
|
||||||
lua_tostring(L, -1));
|
lua_tostring(L, -1));
|
||||||
exit(EXIT_FAILURE); /* do not return to Lua */
|
return (exit(EXIT_FAILURE), 0); /* do not return to Lua */
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
5
loslib.c
5
loslib.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: loslib.c,v 1.20 2006/09/19 13:57:08 roberto Exp roberto $
|
** $Id: loslib.c,v 1.21 2007/05/03 20:49:29 roberto Exp roberto $
|
||||||
** Standard Operating System library
|
** Standard Operating System library
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -224,8 +224,7 @@ static int os_setlocale (lua_State *L) {
|
|||||||
|
|
||||||
|
|
||||||
static int os_exit (lua_State *L) {
|
static int os_exit (lua_State *L) {
|
||||||
exit(luaL_optint(L, 1, EXIT_SUCCESS));
|
return (exit(luaL_optint(L, 1, EXIT_SUCCESS)), 0); /* avoid warnings */
|
||||||
return 0; /* to avoid warnings */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const luaL_Reg syslib[] = {
|
static const luaL_Reg syslib[] = {
|
||||||
|
Loading…
Reference in New Issue
Block a user