diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-10-01 08:54:56 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-10-01 08:54:56 -0300 |
commit | 798660c9cddef8a73f68058576e3d47eed2b1a27 (patch) | |
tree | a0aef60fd2f6910ea7ecf6be127f9035e9ce3e07 /lstrlib.c | |
parent | 34b6664dcb28b18ca3f08ed5e36da094b007eb7b (diff) | |
download | lua-798660c9cddef8a73f68058576e3d47eed2b1a27.tar.gz lua-798660c9cddef8a73f68058576e3d47eed2b1a27.tar.bz2 lua-798660c9cddef8a73f68058576e3d47eed2b1a27.zip |
deprecated "cast macros" ('luaL_checkint', 'luaL_optint', etc.)
Diffstat (limited to 'lstrlib.c')
-rw-r--r-- | lstrlib.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstrlib.c,v 1.200 2014/07/30 13:59:24 roberto Exp roberto $ | 2 | ** $Id: lstrlib.c,v 1.201 2014/08/20 22:06:41 roberto Exp roberto $ |
3 | ** Standard library for string operations and pattern-matching | 3 | ** Standard library for string operations and pattern-matching |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -890,7 +890,7 @@ static int str_format (lua_State *L) { | |||
890 | strfrmt = scanformat(L, strfrmt, form); | 890 | strfrmt = scanformat(L, strfrmt, form); |
891 | switch (*strfrmt++) { | 891 | switch (*strfrmt++) { |
892 | case 'c': { | 892 | case 'c': { |
893 | nb = sprintf(buff, form, luaL_checkint(L, arg)); | 893 | nb = sprintf(buff, form, (int)luaL_checkinteger(L, arg)); |
894 | break; | 894 | break; |
895 | } | 895 | } |
896 | case 'd': case 'i': | 896 | case 'd': case 'i': |
@@ -984,11 +984,11 @@ static int getendian (lua_State *L, int arg) { | |||
984 | 984 | ||
985 | 985 | ||
986 | static int getintsize (lua_State *L, int arg) { | 986 | static int getintsize (lua_State *L, int arg) { |
987 | int size = luaL_optint(L, arg, 0); | 987 | lua_Integer size = luaL_optinteger(L, arg, 0); |
988 | if (size == 0) size = SZINT; | 988 | if (size == 0) size = SZINT; |
989 | luaL_argcheck(L, 1 <= size && size <= MAXINTSIZE, arg, | 989 | luaL_argcheck(L, 1 <= size && size <= MAXINTSIZE, arg, |
990 | "integer size out of valid range"); | 990 | "integer size out of valid range"); |
991 | return size; | 991 | return (int)size; |
992 | } | 992 | } |
993 | 993 | ||
994 | 994 | ||