aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2013-03-19 10:19:12 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2013-03-19 10:19:12 -0300
commite3a7104b404d9e19f8f125fa603a5d40a63f553d (patch)
tree2be99c4ed4b5d47f3015eca4f6748dfc171cd078
parent76492b4bb27a8695483449c433f4104df7b778ed (diff)
downloadlua-e3a7104b404d9e19f8f125fa603a5d40a63f553d.tar.gz
lua-e3a7104b404d9e19f8f125fa603a5d40a63f553d.tar.bz2
lua-e3a7104b404d9e19f8f125fa603a5d40a63f553d.zip
detail (avoiding warnings)
-rw-r--r--lbitlib.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lbitlib.c b/lbitlib.c
index c222e574..8650dc34 100644
--- a/lbitlib.c
+++ b/lbitlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lbitlib.c,v 1.16 2011/06/20 16:35:23 roberto Exp roberto $ 2** $Id: lbitlib.c,v 1.17 2013/02/21 13:44:53 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*/
@@ -147,7 +147,9 @@ static int b_rrot (lua_State *L) {
147 147
148/* 148/*
149** get field and width arguments for field-manipulation functions, 149** get field and width arguments for field-manipulation functions,
150** checking whether they are valid 150** checking whether they are valid.
151** ('luaL_error' called without 'return' to avoid later warnings about
152** 'width' being used uninitialized.)
151*/ 153*/
152static int fieldargs (lua_State *L, int farg, int *width) { 154static int fieldargs (lua_State *L, int farg, int *width) {
153 int f = luaL_checkint(L, farg); 155 int f = luaL_checkint(L, farg);
@@ -155,7 +157,7 @@ static int fieldargs (lua_State *L, int farg, int *width) {
155 luaL_argcheck(L, 0 <= f, farg, "field cannot be negative"); 157 luaL_argcheck(L, 0 <= f, farg, "field cannot be negative");
156 luaL_argcheck(L, 0 < w, farg + 1, "width must be positive"); 158 luaL_argcheck(L, 0 < w, farg + 1, "width must be positive");
157 if (f + w > LUA_NBITS) 159 if (f + w > LUA_NBITS)
158 return luaL_error(L, "trying to access non-existent bits"); 160 luaL_error(L, "trying to access non-existent bits");
159 *width = w; 161 *width = w;
160 return f; 162 return f;
161} 163}