mirror of
https://github.com/lua/lua.git
synced 2025-01-14 05:43:00 +08:00
'luaL_typeerror' deprecated
This commit is contained in:
parent
fa1f724378
commit
e885b91326
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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).
|
||||
|
Loading…
x
Reference in New Issue
Block a user