diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-03-16 11:18:18 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2018-03-16 11:18:18 -0300 |
| commit | 89da4168df5c8f6199504fed6e25fc5326c14fd2 (patch) | |
| tree | 0edb4273c895bbd18ec1eab2f97ea03bb5aba173 /ltablib.c | |
| parent | 6b01b6cf6a1631f7ca2ce527a5c355517095c209 (diff) | |
| download | lua-89da4168df5c8f6199504fed6e25fc5326c14fd2.tar.gz lua-89da4168df5c8f6199504fed6e25fc5326c14fd2.tar.bz2 lua-89da4168df5c8f6199504fed6e25fc5326c14fd2.zip | |
avoid functions named 'pack'
(name too common, may collide when doing 'onelua.c')
Diffstat (limited to 'ltablib.c')
| -rw-r--r-- | ltablib.c | 10 |
1 files changed, 5 insertions, 5 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ltablib.c,v 1.94 2018/02/25 12:48:16 roberto Exp roberto $ | 2 | ** $Id: ltablib.c,v 1.95 2018/02/27 18:47:32 roberto Exp roberto $ |
| 3 | ** Library for Table Manipulation | 3 | ** Library for Table Manipulation |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -173,7 +173,7 @@ static int tconcat (lua_State *L) { | |||
| 173 | ** ======================================================= | 173 | ** ======================================================= |
| 174 | */ | 174 | */ |
| 175 | 175 | ||
| 176 | static int pack (lua_State *L) { | 176 | static int tpack (lua_State *L) { |
| 177 | int i; | 177 | int i; |
| 178 | int n = lua_gettop(L); /* number of elements to pack */ | 178 | int n = lua_gettop(L); /* number of elements to pack */ |
| 179 | lua_createtable(L, n, 1); /* create result table */ | 179 | lua_createtable(L, n, 1); /* create result table */ |
| @@ -186,7 +186,7 @@ static int pack (lua_State *L) { | |||
| 186 | } | 186 | } |
| 187 | 187 | ||
| 188 | 188 | ||
| 189 | static int unpack (lua_State *L) { | 189 | static int tunpack (lua_State *L) { |
| 190 | lua_Unsigned n; | 190 | lua_Unsigned n; |
| 191 | lua_Integer i = luaL_optinteger(L, 2, 1); | 191 | lua_Integer i = luaL_optinteger(L, 2, 1); |
| 192 | lua_Integer e = luaL_opt(L, luaL_checkinteger, 3, luaL_len(L, 1)); | 192 | lua_Integer e = luaL_opt(L, luaL_checkinteger, 3, luaL_len(L, 1)); |
| @@ -408,8 +408,8 @@ static int sort (lua_State *L) { | |||
| 408 | static const luaL_Reg tab_funcs[] = { | 408 | static const luaL_Reg tab_funcs[] = { |
| 409 | {"concat", tconcat}, | 409 | {"concat", tconcat}, |
| 410 | {"insert", tinsert}, | 410 | {"insert", tinsert}, |
| 411 | {"pack", pack}, | 411 | {"pack", tpack}, |
| 412 | {"unpack", unpack}, | 412 | {"unpack", tunpack}, |
| 413 | {"remove", tremove}, | 413 | {"remove", tremove}, |
| 414 | {"move", tmove}, | 414 | {"move", tmove}, |
| 415 | {"sort", sort}, | 415 | {"sort", sort}, |
