diff options
Diffstat (limited to 'lauxlib.c')
-rw-r--r-- | lauxlib.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lauxlib.c,v 1.42 2000/10/30 12:38:50 roberto Exp roberto $ | 2 | ** $Id: lauxlib.c,v 1.43 2000/10/30 13:07:48 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 | */ |
@@ -84,15 +84,15 @@ LUALIB_API const char *luaL_opt_lstr (lua_State *L, int narg, const char *def, s | |||
84 | } | 84 | } |
85 | 85 | ||
86 | 86 | ||
87 | LUALIB_API double luaL_check_number (lua_State *L, int narg) { | 87 | LUALIB_API lua_Number luaL_check_number (lua_State *L, int narg) { |
88 | double d = lua_tonumber(L, narg); | 88 | lua_Number d = lua_tonumber(L, narg); |
89 | if (d == 0 && !lua_isnumber(L, narg)) /* avoid extra test when d is not 0 */ | 89 | if (d == 0 && !lua_isnumber(L, narg)) /* avoid extra test when d is not 0 */ |
90 | type_error(L, narg, LUA_TNUMBER); | 90 | type_error(L, narg, LUA_TNUMBER); |
91 | return d; | 91 | return d; |
92 | } | 92 | } |
93 | 93 | ||
94 | 94 | ||
95 | LUALIB_API double luaL_opt_number (lua_State *L, int narg, double def) { | 95 | LUALIB_API lua_Number luaL_opt_number (lua_State *L, int narg, lua_Number def) { |
96 | if (lua_isnull(L, narg)) return def; | 96 | if (lua_isnull(L, narg)) return def; |
97 | else return luaL_check_number(L, narg); | 97 | else return luaL_check_number(L, narg); |
98 | } | 98 | } |