diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2007-09-14 10:26:28 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2007-09-14 10:26:28 -0300 |
commit | 9cb0607f6f685c78f4191743c387a067117524bb (patch) | |
tree | 87d9eacb94cf9b5f3ff3ec8f62cf401f961c2cb4 | |
parent | 8998032f66ce11d3eac6c0730a39a3e676b0733c (diff) | |
download | lua-9cb0607f6f685c78f4191743c387a067117524bb.tar.gz lua-9cb0607f6f685c78f4191743c387a067117524bb.tar.bz2 lua-9cb0607f6f685c78f4191743c387a067117524bb.zip |
avoid warnings about exit; return
-rw-r--r-- | lauxlib.c | 5 | ||||
-rw-r--r-- | loslib.c | 5 |
2 files changed, 4 insertions, 6 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lauxlib.c,v 1.172 2007/08/10 12:56:02 roberto Exp roberto $ | 2 | ** $Id: lauxlib.c,v 1.173 2007/09/05 17:17:39 roberto Exp roberto $ |
3 | ** Auxiliary functions for building Lua libraries | 3 | ** Auxiliary functions for building Lua libraries |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -661,8 +661,7 @@ static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) { | |||
661 | static int panic (lua_State *L) { | 661 | static int panic (lua_State *L) { |
662 | fprintf(stderr, "PANIC: unprotected error in call to Lua API (%s)\n", | 662 | fprintf(stderr, "PANIC: unprotected error in call to Lua API (%s)\n", |
663 | lua_tostring(L, -1)); | 663 | lua_tostring(L, -1)); |
664 | exit(EXIT_FAILURE); /* do not return to Lua */ | 664 | return (exit(EXIT_FAILURE), 0); /* do not return to Lua */ |
665 | return 0; | ||
666 | } | 665 | } |
667 | 666 | ||
668 | 667 | ||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: loslib.c,v 1.20 2006/09/19 13:57:08 roberto Exp roberto $ | 2 | ** $Id: loslib.c,v 1.21 2007/05/03 20:49:29 roberto Exp roberto $ |
3 | ** Standard Operating System library | 3 | ** Standard Operating System library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -224,8 +224,7 @@ static int os_setlocale (lua_State *L) { | |||
224 | 224 | ||
225 | 225 | ||
226 | static int os_exit (lua_State *L) { | 226 | static int os_exit (lua_State *L) { |
227 | exit(luaL_optint(L, 1, EXIT_SUCCESS)); | 227 | return (exit(luaL_optint(L, 1, EXIT_SUCCESS)), 0); /* avoid warnings */ |
228 | return 0; /* to avoid warnings */ | ||
229 | } | 228 | } |
230 | 229 | ||
231 | static const luaL_Reg syslib[] = { | 230 | static const luaL_Reg syslib[] = { |