diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-09-17 12:51:05 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-09-17 12:51:05 -0300 |
| commit | ee5edb6b680589805c8fc348f6a7566c2bd8735d (patch) | |
| tree | ca0d801e40a0dcf98c4594bdaf97933193bfea71 /lstring.c | |
| parent | bda83e22c0ab3e6fffbf0a71e5e4a5869da8f6ab (diff) | |
| download | lua-github-ee5edb6b680589805c8fc348f6a7566c2bd8735d.tar.gz | |
macros 'getaddrstr' and 'getstr' unified (they do the same thing)
Diffstat (limited to 'lstring.c')
| -rw-r--r-- | lstring.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,5 +1,5 @@ /* -** $Id: lstring.c,v 2.50 2015/06/18 14:20:32 roberto Exp roberto $ +** $Id: lstring.c,v 2.51 2015/09/08 15:41:05 roberto Exp roberto $ ** String table (keeps all strings handled by Lua) ** See Copyright Notice in lua.h */ @@ -128,7 +128,7 @@ static TString *createstrobj (lua_State *L, size_t l, int tag, unsigned int h) { ts = gco2ts(o); ts->hash = h; ts->extra = 0; - getaddrstr(ts)[l] = '\0'; /* ending 0 */ + getstr(ts)[l] = '\0'; /* ending 0 */ return ts; } @@ -172,7 +172,7 @@ static TString *internshrstr (lua_State *L, const char *str, size_t l) { list = &g->strt.hash[lmod(h, g->strt.size)]; /* recompute with new size */ } ts = createstrobj(L, l, LUA_TSHRSTR, h); - memcpy(getaddrstr(ts), str, l * sizeof(char)); + memcpy(getstr(ts), str, l * sizeof(char)); ts->shrlen = cast_byte(l); ts->u.hnext = *list; *list = ts; @@ -192,7 +192,7 @@ TString *luaS_newlstr (lua_State *L, const char *str, size_t l) { if (l >= (MAX_SIZE - sizeof(TString))/sizeof(char)) luaM_toobig(L); ts = luaS_createlngstrobj(L, l); - memcpy(getaddrstr(ts), str, l * sizeof(char)); + memcpy(getstr(ts), str, l * sizeof(char)); return ts; } } |
