summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-04-30 10:01:48 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2002-04-30 10:01:48 -0300
commitab52fc6097569cf51bc0c55dd5b6b1329eefd970 (patch)
tree776f1c7b8b42d519aef011edb0ea9e439d10325d
parente68d0df1c6144551eedda90e0a99d850b1461df1 (diff)
downloadlua-github-ab52fc6097569cf51bc0c55dd5b6b1329eefd970.tar.gz
new macro to `fix' strings
-rw-r--r--lstring.h4
-rw-r--r--ltm.c4
2 files changed, 5 insertions, 3 deletions
diff --git a/lstring.h b/lstring.h
index 2fbf1daf..d1b0f14a 100644
--- a/lstring.h
+++ b/lstring.h
@@ -1,5 +1,5 @@
/*
-** $Id: lstring.h,v 1.34 2001/08/31 19:46:07 roberto Exp $
+** $Id: lstring.h,v 1.35 2001/11/28 20:13:13 roberto Exp roberto $
** String table (keep all strings handled by Lua)
** See Copyright Notice in lua.h
*/
@@ -30,6 +30,8 @@
#define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \
(sizeof(s)/sizeof(char))-1))
+#define luaS_fix(s) ((s)->tsv.marked = FIXMARK)
+
void luaS_resize (lua_State *L, int newsize);
Udata *luaS_newudata (lua_State *L, size_t s);
void luaS_freeall (lua_State *L);
diff --git a/ltm.c b/ltm.c
index 5a4c72ac..7f6ebc63 100644
--- a/ltm.c
+++ b/ltm.c
@@ -1,5 +1,5 @@
/*
-** $Id: ltm.c,v 1.88 2002/03/18 20:24:14 roberto Exp roberto $
+** $Id: ltm.c,v 1.89 2002/04/05 18:54:31 roberto Exp roberto $
** Tag methods
** See Copyright Notice in lua.h
*/
@@ -35,7 +35,7 @@ void luaT_init (lua_State *L) {
int i;
for (i=0; i<TM_N; i++) {
G(L)->tmname[i] = luaS_new(L, luaT_eventname[i]);
- G(L)->tmname[i]->tsv.marked = FIXMARK; /* never collect these names */
+ luaS_fix(G(L)->tmname[i]); /* never collect these names */
}
}