diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-02-21 10:44:53 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2013-02-21 10:44:53 -0300 |
commit | a83ed55f1e3e20f73d01489c18889bb8554593ce (patch) | |
tree | 816177a00ce20b36503b6a48bb7d1956c0432859 | |
parent | b559aed2d38c6eafcc624da8599b6ac52e11f17c (diff) | |
download | lua-a83ed55f1e3e20f73d01489c18889bb8554593ce.tar.gz lua-a83ed55f1e3e20f73d01489c18889bb8554593ce.tar.bz2 lua-a83ed55f1e3e20f73d01489c18889bb8554593ce.zip |
added 'return' (when possible) to calls to error functions
-rw-r--r-- | lbaselib.c | 5 | ||||
-rw-r--r-- | lbitlib.c | 4 | ||||
-rw-r--r-- | lcorolib.c | 4 |
3 files changed, 7 insertions, 6 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lbaselib.c,v 1.274 2012/04/27 14:13:19 roberto Exp roberto $ | 2 | ** $Id: lbaselib.c,v 1.275 2012/12/03 20:18:02 roberto Exp roberto $ |
3 | ** Basic library | 3 | ** Basic library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -336,7 +336,8 @@ static int dofilecont (lua_State *L) { | |||
336 | static int luaB_dofile (lua_State *L) { | 336 | static int luaB_dofile (lua_State *L) { |
337 | const char *fname = luaL_optstring(L, 1, NULL); | 337 | const char *fname = luaL_optstring(L, 1, NULL); |
338 | lua_settop(L, 1); | 338 | lua_settop(L, 1); |
339 | if (luaL_loadfile(L, fname) != LUA_OK) lua_error(L); | 339 | if (luaL_loadfile(L, fname) != LUA_OK) |
340 | return lua_error(L); | ||
340 | lua_callk(L, 0, LUA_MULTRET, 0, dofilecont); | 341 | lua_callk(L, 0, LUA_MULTRET, 0, dofilecont); |
341 | return dofilecont(L); | 342 | return dofilecont(L); |
342 | } | 343 | } |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lbitlib.c,v 1.15 2010/12/17 13:26:38 roberto Exp roberto $ | 2 | ** $Id: lbitlib.c,v 1.16 2011/06/20 16:35:23 roberto Exp roberto $ |
3 | ** Standard library for bitwise operations | 3 | ** Standard library for bitwise operations |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -155,7 +155,7 @@ static int fieldargs (lua_State *L, int farg, int *width) { | |||
155 | luaL_argcheck(L, 0 <= f, farg, "field cannot be negative"); | 155 | luaL_argcheck(L, 0 <= f, farg, "field cannot be negative"); |
156 | luaL_argcheck(L, 0 < w, farg + 1, "width must be positive"); | 156 | luaL_argcheck(L, 0 < w, farg + 1, "width must be positive"); |
157 | if (f + w > LUA_NBITS) | 157 | if (f + w > LUA_NBITS) |
158 | luaL_error(L, "trying to access non-existent bits"); | 158 | return luaL_error(L, "trying to access non-existent bits"); |
159 | *width = w; | 159 | *width = w; |
160 | return f; | 160 | return f; |
161 | } | 161 | } |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lcorolib.c,v 1.3 2011/08/23 17:24:34 roberto Exp roberto $ | 2 | ** $Id: lcorolib.c,v 1.4 2012/04/27 18:59:04 roberto Exp roberto $ |
3 | ** Coroutine Library | 3 | ** Coroutine Library |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -73,7 +73,7 @@ static int luaB_auxwrap (lua_State *L) { | |||
73 | lua_insert(L, -2); | 73 | lua_insert(L, -2); |
74 | lua_concat(L, 2); | 74 | lua_concat(L, 2); |
75 | } | 75 | } |
76 | lua_error(L); /* propagate error */ | 76 | return lua_error(L); /* propagate error */ |
77 | } | 77 | } |
78 | return r; | 78 | return r; |
79 | } | 79 | } |