No need for L argument to lj_str_initbuf().

This commit is contained in:
Mike Pall 2011-06-12 21:09:20 +02:00
parent 287de611a2
commit 0c8696dfbf
4 changed files with 4 additions and 4 deletions

View File

@ -1133,7 +1133,7 @@ LUA_API int lua_load(lua_State *L, lua_Reader reader, void *data,
ls.rfunc = reader; ls.rfunc = reader;
ls.rdata = data; ls.rdata = data;
ls.chunkarg = chunkname ? chunkname : "?"; ls.chunkarg = chunkname ? chunkname : "?";
lj_str_initbuf(L, &ls.sb); lj_str_initbuf(&ls.sb);
status = lj_vm_cpcall(L, NULL, &ls, cpparser); status = lj_vm_cpcall(L, NULL, &ls, cpparser);
lj_lex_cleanup(L, &ls); lj_lex_cleanup(L, &ls);
lj_gc_check(L); lj_gc_check(L);

View File

@ -364,7 +364,7 @@ static void cp_init(CPState *cp)
cp->depth = 0; cp->depth = 0;
cp->curpack = 0; cp->curpack = 0;
cp->packstack[0] = 255; cp->packstack[0] = 255;
lj_str_initbuf(cp->L, &cp->sb); lj_str_initbuf(&cp->sb);
lj_str_resizebuf(cp->L, &cp->sb, LJ_MIN_SBUF); lj_str_resizebuf(cp->L, &cp->sb, LJ_MIN_SBUF);
lua_assert(cp->p != NULL); lua_assert(cp->p != NULL);
cp_get(cp); /* Read-ahead first char. */ cp_get(cp); /* Read-ahead first char. */

View File

@ -203,7 +203,7 @@ LUA_API lua_State *lua_newstate(lua_Alloc f, void *ud)
setnilV(&g->nilnode.val); setnilV(&g->nilnode.val);
setnilV(&g->nilnode.key); setnilV(&g->nilnode.key);
setmref(g->nilnode.freetop, &g->nilnode); setmref(g->nilnode.freetop, &g->nilnode);
lj_str_initbuf(L, &g->tmpbuf); lj_str_initbuf(&g->tmpbuf);
g->gc.state = GCSpause; g->gc.state = GCSpause;
setgcref(g->gc.root, obj2gco(L)); setgcref(g->gc.root, obj2gco(L));
setmref(g->gc.sweep, &g->gc.root); setmref(g->gc.sweep, &g->gc.root);

View File

@ -43,7 +43,7 @@ LJ_FUNC const char *lj_str_pushf(lua_State *L, const char *fmt, ...)
/* Resizable string buffers. Struct definition in lj_obj.h. */ /* Resizable string buffers. Struct definition in lj_obj.h. */
LJ_FUNC char *lj_str_needbuf(lua_State *L, SBuf *sb, MSize sz); LJ_FUNC char *lj_str_needbuf(lua_State *L, SBuf *sb, MSize sz);
#define lj_str_initbuf(L, sb) ((sb)->buf = NULL, (sb)->sz = 0) #define lj_str_initbuf(sb) ((sb)->buf = NULL, (sb)->sz = 0)
#define lj_str_resetbuf(sb) ((sb)->n = 0) #define lj_str_resetbuf(sb) ((sb)->n = 0)
#define lj_str_resizebuf(L, sb, size) \ #define lj_str_resizebuf(L, sb, size) \
((sb)->buf = (char *)lj_mem_realloc(L, (sb)->buf, (sb)->sz, (size)), \ ((sb)->buf = (char *)lj_mem_realloc(L, (sb)->buf, (sb)->sz, (size)), \