summaryrefslogtreecommitdiff
path: root/lstring.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-07-18 10:36:14 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2014-07-18 10:36:14 -0300
commitca41b43f53562e64abe433d6346d174c92548603 (patch)
tree03f7a99f76359fc1e0bbc45fc13e579ff2aafabb /lstring.h
parent3511e186cde4b78f268d17199d0f46fb3eaa9638 (diff)
downloadlua-github-ca41b43f53562e64abe433d6346d174c92548603.tar.gz
type 'TString' refers directly to the structure inside the union
(union used only for size purposes)
Diffstat (limited to 'lstring.h')
-rw-r--r--lstring.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/lstring.h b/lstring.h
index ecbe1cfb..f4f60a20 100644
--- a/lstring.h
+++ b/lstring.h
@@ -1,5 +1,5 @@
/*
-** $Id: lstring.h,v 1.53 2014/02/19 13:51:09 roberto Exp roberto $
+** $Id: lstring.h,v 1.54 2014/03/19 18:51:42 roberto Exp roberto $
** String table (keep all strings handled by Lua)
** See Copyright Notice in lua.h
*/
@@ -12,7 +12,8 @@
#include "lstate.h"
-#define sizestring(s) (sizeof(union TString)+((s)->len+1)*sizeof(char))
+#define sizelstring(l) (sizeof(union UTString) + ((l) + 1) * sizeof(char))
+#define sizestring(s) sizelstring((s)->len)
#define sizeudata(u) (sizeof(union Udata)+(u)->len)
@@ -23,13 +24,13 @@
/*
** test whether a string is a reserved word
*/
-#define isreserved(s) ((s)->tsv.tt == LUA_TSHRSTR && (s)->tsv.extra > 0)
+#define isreserved(s) ((s)->tt == LUA_TSHRSTR && (s)->extra > 0)
/*
** equality for short strings, which are always internalized
*/
-#define eqshrstr(a,b) check_exp((a)->tsv.tt == LUA_TSHRSTR, (a) == (b))
+#define eqshrstr(a,b) check_exp((a)->tt == LUA_TSHRSTR, (a) == (b))
LUAI_FUNC unsigned int luaS_hash (const char *str, size_t l, unsigned int seed);