From e885b91326986f1b5a341e9ff1444c4f46c6241a Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 10 Nov 2010 15:38:10 -0200 Subject: [PATCH] 'luaL_typeerror' deprecated --- lauxlib.c | 8 ++++---- lauxlib.h | 3 +-- luaconf.h | 5 +---- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/lauxlib.c b/lauxlib.c index 9391ae28..9dbf5519 100644 --- a/lauxlib.c +++ b/lauxlib.c @@ -1,5 +1,5 @@ /* -** $Id: lauxlib.c,v 1.224 2010/10/29 12:52:21 roberto Exp roberto $ +** $Id: lauxlib.c,v 1.225 2010/11/09 11:04:15 roberto Exp roberto $ ** Auxiliary functions for building Lua libraries ** See Copyright Notice in lua.h */ @@ -168,7 +168,7 @@ LUALIB_API int luaL_argerror (lua_State *L, int narg, const char *extramsg) { } -LUALIB_API int luaL_typeerror (lua_State *L, int narg, const char *tname) { +static int typeerror (lua_State *L, int narg, const char *tname) { const char *msg = lua_pushfstring(L, "%s expected, got %s", tname, luaL_typename(L, narg)); return luaL_argerror(L, narg, msg); @@ -176,7 +176,7 @@ LUALIB_API int luaL_typeerror (lua_State *L, int narg, const char *tname) { static void tag_error (lua_State *L, int narg, int tag) { - luaL_typeerror(L, narg, lua_typename(L, tag)); + typeerror(L, narg, lua_typename(L, tag)); } @@ -241,7 +241,7 @@ LUALIB_API void *luaL_testudata (lua_State *L, int ud, const char *tname) { LUALIB_API void *luaL_checkudata (lua_State *L, int ud, const char *tname) { void *p = luaL_testudata(L, ud, tname); - if (p == NULL) luaL_typeerror(L, ud, tname); + if (p == NULL) typeerror(L, ud, tname); return p; } diff --git a/lauxlib.h b/lauxlib.h index 88d35a11..c39b033b 100644 --- a/lauxlib.h +++ b/lauxlib.h @@ -1,5 +1,5 @@ /* -** $Id: lauxlib.h,v 1.108 2010/07/02 11:38:13 roberto Exp roberto $ +** $Id: lauxlib.h,v 1.109 2010/10/25 20:31:11 roberto Exp roberto $ ** Auxiliary functions for building Lua libraries ** See Copyright Notice in lua.h */ @@ -32,7 +32,6 @@ LUALIB_API void (luaL_checkversion_) (lua_State *L, lua_Number ver); LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e); LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e); LUALIB_API const char *(luaL_tolstring) (lua_State *L, int idx, size_t *len); -LUALIB_API int (luaL_typeerror) (lua_State *L, int narg, const char *tname); LUALIB_API int (luaL_argerror) (lua_State *L, int numarg, const char *extramsg); LUALIB_API const char *(luaL_checklstring) (lua_State *L, int numArg, size_t *l); diff --git a/luaconf.h b/luaconf.h index 3305434b..a3a820c1 100644 --- a/luaconf.h +++ b/luaconf.h @@ -1,5 +1,5 @@ /* -** $Id: luaconf.h,v 1.148 2010/10/29 17:52:46 roberto Exp roberto $ +** $Id: luaconf.h,v 1.149 2010/11/03 15:16:17 roberto Exp roberto $ ** Configuration file for Lua ** See Copyright Notice in lua.h */ @@ -278,9 +278,6 @@ #define lua_equal(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPEQ) #define lua_lessthan(L,idx1,idx2) lua_compare(L,(idx1),(idx2),LUA_OPLT) -/* compatibility with previous wrong spelling */ -#define luaL_typerror luaL_typeerror - /* @@ LUA_COMPAT_MODULE controls compatibility with previous ** module functions 'module' (Lua) and 'luaL_register' (C).