From ca41b43f53562e64abe433d6346d174c92548603 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 18 Jul 2014 10:36:14 -0300 Subject: type 'TString' refers directly to the structure inside the union (union used only for size purposes) --- lstring.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lstring.h') 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); -- cgit v1.2.3-55-g6feb