mirror of
https://github.com/lua/lua.git
synced 2025-01-28 06:03:00 +08:00
'luaL_len' returns lua_Integer instead of 'int'
This commit is contained in:
parent
80cdf39d0e
commit
982aa7058f
10
lauxlib.c
10
lauxlib.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lauxlib.c,v 1.252 2013/06/14 18:34:49 roberto Exp roberto $
|
** $Id: lauxlib.c,v 1.253 2013/06/14 20:46:40 roberto Exp roberto $
|
||||||
** Auxiliary functions for building Lua libraries
|
** Auxiliary functions for building Lua libraries
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -731,13 +731,13 @@ LUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LUALIB_API int luaL_len (lua_State *L, int idx) {
|
LUALIB_API lua_Integer luaL_len (lua_State *L, int idx) {
|
||||||
int l;
|
lua_Integer l;
|
||||||
int isnum;
|
int isnum;
|
||||||
lua_len(L, idx);
|
lua_len(L, idx);
|
||||||
l = (int)lua_tointegerx(L, -1, &isnum);
|
l = lua_tointegerx(L, -1, &isnum);
|
||||||
if (!isnum)
|
if (!isnum)
|
||||||
luaL_error(L, "object length is not a number");
|
luaL_error(L, "object length is not an integer");
|
||||||
lua_pop(L, 1); /* remove object */
|
lua_pop(L, 1); /* remove object */
|
||||||
return l;
|
return l;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lauxlib.h,v 1.119 2011/11/14 17:10:24 roberto Exp roberto $
|
** $Id: lauxlib.h,v 1.120 2011/11/29 15:55:08 roberto Exp roberto $
|
||||||
** Auxiliary functions for building Lua libraries
|
** Auxiliary functions for building Lua libraries
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -83,7 +83,7 @@ LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s);
|
|||||||
|
|
||||||
LUALIB_API lua_State *(luaL_newstate) (void);
|
LUALIB_API lua_State *(luaL_newstate) (void);
|
||||||
|
|
||||||
LUALIB_API int (luaL_len) (lua_State *L, int idx);
|
LUALIB_API lua_Integer (luaL_len) (lua_State *L, int idx);
|
||||||
|
|
||||||
LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p,
|
LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p,
|
||||||
const char *r);
|
const char *r);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user