diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-06-15 17:36:57 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-06-15 17:36:57 -0300 |
commit | 8e586c13fcf3066886a7edd69011304eaad57a2b (patch) | |
tree | 417c2102ba8c4d693c49a2df839612d371eded50 /llex.c | |
parent | eadf2aaaffa7a35e7f67b150ce0d57f2c17b9231 (diff) | |
download | lua-8e586c13fcf3066886a7edd69011304eaad57a2b.tar.gz lua-8e586c13fcf3066886a7edd69011304eaad57a2b.tar.bz2 lua-8e586c13fcf3066886a7edd69011304eaad57a2b.zip |
cleaner way to ensure alignment for strings and userdata
Diffstat (limited to 'llex.c')
-rw-r--r-- | llex.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llex.c,v 1.85 2001/06/07 15:01:21 roberto Exp roberto $ | 2 | ** $Id: llex.c,v 1.86 2001/06/13 14:25:49 roberto Exp roberto $ |
3 | ** Lexical Analyzer | 3 | ** Lexical Analyzer |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -40,7 +40,7 @@ void luaX_init (lua_State *L) { | |||
40 | for (i=0; i<NUM_RESERVED; i++) { | 40 | for (i=0; i<NUM_RESERVED; i++) { |
41 | TString *ts = luaS_new(L, token2string[i]); | 41 | TString *ts = luaS_new(L, token2string[i]); |
42 | lua_assert(strlen(token2string[i])+1 <= TOKEN_LEN); | 42 | lua_assert(strlen(token2string[i])+1 <= TOKEN_LEN); |
43 | ts->marked = (unsigned short)(RESERVEDMARK+i); /* reserved word */ | 43 | ts->tsv.marked = (unsigned short)(RESERVEDMARK+i); /* reserved word */ |
44 | } | 44 | } |
45 | } | 45 | } |
46 | 46 | ||
@@ -370,8 +370,8 @@ int luaX_lex (LexState *LS, SemInfo *seminfo) { | |||
370 | /* identifier or reserved word */ | 370 | /* identifier or reserved word */ |
371 | size_t l = readname(LS); | 371 | size_t l = readname(LS); |
372 | TString *ts = luaS_newlstr(LS->L, (l_char *)G(LS->L)->Mbuffer, l); | 372 | TString *ts = luaS_newlstr(LS->L, (l_char *)G(LS->L)->Mbuffer, l); |
373 | if (ts->marked >= RESERVEDMARK) /* reserved word? */ | 373 | if (ts->tsv.marked >= RESERVEDMARK) /* reserved word? */ |
374 | return ts->marked-RESERVEDMARK+FIRST_RESERVED; | 374 | return ts->tsv.marked-RESERVEDMARK+FIRST_RESERVED; |
375 | seminfo->ts = ts; | 375 | seminfo->ts = ts; |
376 | return TK_NAME; | 376 | return TK_NAME; |
377 | } | 377 | } |