aboutsummaryrefslogtreecommitdiff
path: root/lauxlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lauxlib.c')
-rw-r--r--lauxlib.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/lauxlib.c b/lauxlib.c
index f68c3fba..34f1cc77 100644
--- a/lauxlib.c
+++ b/lauxlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lauxlib.c,v 1.154 2005/10/19 13:05:11 roberto Exp roberto $ 2** $Id: lauxlib.c,v 1.155 2005/10/20 11:35:25 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*/
@@ -176,8 +176,7 @@ LUALIB_API lua_Number luaL_checknumber (lua_State *L, int narg) {
176 176
177 177
178LUALIB_API lua_Number luaL_optnumber (lua_State *L, int narg, lua_Number def) { 178LUALIB_API lua_Number luaL_optnumber (lua_State *L, int narg, lua_Number def) {
179 if (lua_isnoneornil(L, narg)) return def; 179 return luaL_opt(L, luaL_checknumber, narg, def);
180 else return luaL_checknumber(L, narg);
181} 180}
182 181
183 182
@@ -190,9 +189,8 @@ LUALIB_API lua_Integer luaL_checkinteger (lua_State *L, int narg) {
190 189
191 190
192LUALIB_API lua_Integer luaL_optinteger (lua_State *L, int narg, 191LUALIB_API lua_Integer luaL_optinteger (lua_State *L, int narg,
193 lua_Integer def) { 192 lua_Integer def) {
194 if (lua_isnoneornil(L, narg)) return def; 193 return luaL_opt(L, luaL_checkinteger, narg, def);
195 else return luaL_checkinteger(L, narg);
196} 194}
197 195
198 196