diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-05-18 09:34:58 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-05-18 09:34:58 -0300 |
commit | 49f7aab62af7e5d5b46c551c1620a8a89f448f7e (patch) | |
tree | f67c7c4f92b8505c2d1a39e04ebacb5a4bcd13fc | |
parent | 3d879fbc5df8076aa02bc0cec48e10b6a9ef0665 (diff) | |
download | lua-49f7aab62af7e5d5b46c551c1620a8a89f448f7e.tar.gz lua-49f7aab62af7e5d5b46c551c1620a8a89f448f7e.tar.bz2 lua-49f7aab62af7e5d5b46c551c1620a8a89f448f7e.zip |
'lua_rawlen' returns 'lua_Unsigned' instead of 'size_t'. (Real
length of strings and userdata are limited by Lua integers,
but table length is hard to compute limiting it to 'size_t'.)
-rw-r--r-- | lapi.c | 4 | ||||
-rw-r--r-- | lua.h | 4 |
2 files changed, 4 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lapi.c,v 2.265 2017/04/24 16:59:26 roberto Exp roberto $ | 2 | ** $Id: lapi.c,v 2.266 2017/05/11 18:57:46 roberto Exp roberto $ |
3 | ** Lua API | 3 | ** Lua API |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -389,7 +389,7 @@ LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) { | |||
389 | } | 389 | } |
390 | 390 | ||
391 | 391 | ||
392 | LUA_API size_t lua_rawlen (lua_State *L, int idx) { | 392 | LUA_API lua_Unsigned lua_rawlen (lua_State *L, int idx) { |
393 | StkId o = index2addr(L, idx); | 393 | StkId o = index2addr(L, idx); |
394 | switch (ttype(o)) { | 394 | switch (ttype(o)) { |
395 | case LUA_TSHRSTR: return tsvalue(o)->shrlen; | 395 | case LUA_TSHRSTR: return tsvalue(o)->shrlen; |
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lua.h,v 1.332 2016/12/22 15:51:20 roberto Exp roberto $ | 2 | ** $Id: lua.h,v 1.333 2017/02/23 21:07:34 roberto Exp roberto $ |
3 | ** Lua - A Scripting Language | 3 | ** Lua - A Scripting Language |
4 | ** Lua.org, PUC-Rio, Brazil (http://www.lua.org) | 4 | ** Lua.org, PUC-Rio, Brazil (http://www.lua.org) |
5 | ** See Copyright Notice at the end of this file | 5 | ** See Copyright Notice at the end of this file |
@@ -182,7 +182,7 @@ LUA_API lua_Number (lua_tonumberx) (lua_State *L, int idx, int *isnum); | |||
182 | LUA_API lua_Integer (lua_tointegerx) (lua_State *L, int idx, int *isnum); | 182 | LUA_API lua_Integer (lua_tointegerx) (lua_State *L, int idx, int *isnum); |
183 | LUA_API int (lua_toboolean) (lua_State *L, int idx); | 183 | LUA_API int (lua_toboolean) (lua_State *L, int idx); |
184 | LUA_API const char *(lua_tolstring) (lua_State *L, int idx, size_t *len); | 184 | LUA_API const char *(lua_tolstring) (lua_State *L, int idx, size_t *len); |
185 | LUA_API size_t (lua_rawlen) (lua_State *L, int idx); | 185 | LUA_API lua_Unsigned (lua_rawlen) (lua_State *L, int idx); |
186 | LUA_API lua_CFunction (lua_tocfunction) (lua_State *L, int idx); | 186 | LUA_API lua_CFunction (lua_tocfunction) (lua_State *L, int idx); |
187 | LUA_API void *(lua_touserdata) (lua_State *L, int idx); | 187 | LUA_API void *(lua_touserdata) (lua_State *L, int idx); |
188 | LUA_API lua_State *(lua_tothread) (lua_State *L, int idx); | 188 | LUA_API lua_State *(lua_tothread) (lua_State *L, int idx); |