aboutsummaryrefslogtreecommitdiff
path: root/lauxlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'lauxlib.c')
-rw-r--r--lauxlib.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lauxlib.c b/lauxlib.c
index fa311a89..7c65dba0 100644
--- a/lauxlib.c
+++ b/lauxlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lauxlib.c,v 1.49 2001/03/26 14:31:49 roberto Exp roberto $ 2** $Id: lauxlib.c,v 1.50 2001/04/23 16:35:45 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*/
@@ -44,7 +44,7 @@ LUALIB_API void luaL_argerror (lua_State *L, int narg, const l_char *extramsg) {
44 44
45static void type_error (lua_State *L, int narg, const l_char *tname) { 45static void type_error (lua_State *L, int narg, const l_char *tname) {
46 l_char buff[80]; 46 l_char buff[80];
47 sprintf(buff, l_s("%.25s expected, got %.25s"), tname, lua_xtypename(L,narg)); 47 sprintf(buff, l_s("%.25s expected, got %.25s"), tname, lua_type(L,narg));
48 luaL_argerror(L, narg, buff); 48 luaL_argerror(L, narg, buff);
49} 49}
50 50
@@ -61,20 +61,20 @@ LUALIB_API void luaL_checkstack (lua_State *L, int space, const l_char *mes) {
61 61
62 62
63LUALIB_API void luaL_checktype(lua_State *L, int narg, int t) { 63LUALIB_API void luaL_checktype(lua_State *L, int narg, int t) {
64 if (lua_type(L, narg) != t) 64 if (lua_rawtag(L, narg) != t)
65 tag_error(L, narg, t); 65 tag_error(L, narg, t);
66} 66}
67 67
68 68
69LUALIB_API void luaL_checkany (lua_State *L, int narg) { 69LUALIB_API void luaL_checkany (lua_State *L, int narg) {
70 if (lua_type(L, narg) == LUA_TNONE) 70 if (lua_rawtag(L, narg) == LUA_TNONE)
71 luaL_argerror(L, narg, l_s("value expected")); 71 luaL_argerror(L, narg, l_s("value expected"));
72} 72}
73 73
74 74
75LUALIB_API void *luaL_check_userdata (lua_State *L, int narg, 75LUALIB_API void *luaL_check_userdata (lua_State *L, int narg,
76 const l_char *name) { 76 const l_char *name) {
77 if (strcmp(lua_xtypename(L, narg), name) != 0) 77 if (strcmp(lua_type(L, narg), name) != 0)
78 type_error(L, narg, name); 78 type_error(L, narg, name);
79 return lua_touserdata(L, narg); 79 return lua_touserdata(L, narg);
80} 80}