Skip to content

Commit 2ecaf18

Browse files
committed
using macros ('rttype' and 'settt_') to access "private" field 'tt_'
1 parent cbef15f commit 2ecaf18

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lobject.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
** $Id: lobject.h,v 2.109 2015/03/14 17:58:57 roberto Exp roberto $
2+
** $Id: lobject.h,v 2.110 2015/04/02 21:10:53 roberto Exp roberto $
33
** Type definitions for Lua objects
44
** See Copyright Notice in lua.h
55
*/
@@ -374,13 +374,13 @@ typedef union UUdata {
374374

375375
#define setuservalue(L,u,o) \
376376
{ const TValue *io=(o); Udata *iu = (u); \
377-
iu->user_ = io->value_; iu->ttuv_ = io->tt_; \
377+
iu->user_ = io->value_; iu->ttuv_ = rttype(io); \
378378
checkliveness(G(L),io); }
379379

380380

381381
#define getuservalue(L,u,o) \
382382
{ TValue *io=(o); const Udata *iu = (u); \
383-
io->value_ = iu->user_; io->tt_ = iu->ttuv_; \
383+
io->value_ = iu->user_; settt_(io, iu->ttuv_); \
384384
checkliveness(G(L),io); }
385385

386386

0 commit comments

Comments
 (0)