diff options
Diffstat (limited to 'lobject.h')
-rw-r--r-- | lobject.h | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lobject.h,v 2.98 2014/07/18 13:36:14 roberto Exp roberto $ | 2 | ** $Id: lobject.h,v 2.99 2014/07/18 14:46:47 roberto Exp roberto $ |
3 | ** Type definitions for Lua objects | 3 | ** Type definitions for Lua objects |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -241,8 +241,7 @@ typedef struct lua_TValue TValue; | |||
241 | 241 | ||
242 | 242 | ||
243 | #define setobj(L,obj1,obj2) \ | 243 | #define setobj(L,obj1,obj2) \ |
244 | { const TValue *io2=(obj2); TValue *io1=(obj1); \ | 244 | { TValue *io1=(obj1); *io1 = *(obj2); \ |
245 | io1->value_ = io2->value_; io1->tt_ = io2->tt_; \ | ||
246 | (void)L; checkliveness(G(L),io1); } | 245 | (void)L; checkliveness(G(L),io1); } |
247 | 246 | ||
248 | 247 | ||
@@ -471,6 +470,13 @@ typedef union TKey { | |||
471 | } TKey; | 470 | } TKey; |
472 | 471 | ||
473 | 472 | ||
473 | /* copy a value into a key without messing up field 'next' */ | ||
474 | #define setkey(L,key,obj) \ | ||
475 | { TKey *k_=(key); const TValue *io_=(obj); \ | ||
476 | k_->nk.value_ = io_->value_; k_->nk.tt_ = io_->tt_; \ | ||
477 | (void)L; checkliveness(G(L),io_); } | ||
478 | |||
479 | |||
474 | typedef struct Node { | 480 | typedef struct Node { |
475 | TValue i_val; | 481 | TValue i_val; |
476 | TKey i_key; | 482 | TKey i_key; |