diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-05-07 15:44:46 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-05-07 15:44:46 -0300 |
| commit | 0bccf03d7e425d6f2d2ead6f49eb67016956b413 (patch) | |
| tree | 145827e8076ba12424267b8c2a44a99355e91660 | |
| parent | ad2b5decc89d254db842289b4f5183ddda68f191 (diff) | |
| download | lua-0bccf03d7e425d6f2d2ead6f49eb67016956b413.tar.gz lua-0bccf03d7e425d6f2d2ead6f49eb67016956b413.tar.bz2 lua-0bccf03d7e425d6f2d2ead6f49eb67016956b413.zip | |
slightly better definition for 'changenvalue'
| -rw-r--r-- | lobject.h | 5 |
1 files changed, 2 insertions, 3 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lobject.h,v 2.38 2010/04/14 15:13:48 roberto Exp roberto $ | 2 | ** $Id: lobject.h,v 2.39 2010/04/18 13:22:48 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 | */ |
| @@ -142,8 +142,7 @@ typedef struct lua_TValue { | |||
| 142 | #define setfvalue(obj,x) \ | 142 | #define setfvalue(obj,x) \ |
| 143 | { TValue *i_o=(obj); i_o->value_.f=(x); i_o->tt_=LUA_TLCF; } | 143 | { TValue *i_o=(obj); i_o->value_.f=(x); i_o->tt_=LUA_TLCF; } |
| 144 | 144 | ||
| 145 | #define changenvalue(obj,x) \ | 145 | #define changenvalue(o,x) check_exp((o)->tt_==LUA_TNUMBER, (o)->value_.n=(x)) |
| 146 | ( lua_assert((obj)->tt_==LUA_TNUMBER), (obj)->value_.n=(x) ) | ||
| 147 | 146 | ||
| 148 | #define setpvalue(obj,x) \ | 147 | #define setpvalue(obj,x) \ |
| 149 | { TValue *i_o=(obj); i_o->value_.p=(x); i_o->tt_=LUA_TLIGHTUSERDATA; } | 148 | { TValue *i_o=(obj); i_o->value_.p=(x); i_o->tt_=LUA_TLIGHTUSERDATA; } |
