diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-06-18 13:36:40 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-06-18 13:36:40 -0300 |
commit | a36c8e1718fd32ea99e29797e5124600a16ccc03 (patch) | |
tree | c7afa61e6da049ac87babb03bcc3ef736e6ff402 | |
parent | d7872dcf91eb2075312a03973a6cdb489610c796 (diff) | |
download | lua-a36c8e1718fd32ea99e29797e5124600a16ccc03.tar.gz lua-a36c8e1718fd32ea99e29797e5124600a16ccc03.tar.bz2 lua-a36c8e1718fd32ea99e29797e5124600a16ccc03.zip |
new macro 'changenvalue'
-rw-r--r-- | lobject.h | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lobject.h,v 2.25 2009/03/26 12:56:38 roberto Exp roberto $ | 2 | ** $Id: lobject.h,v 2.26 2009/06/17 17:48:34 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 | */ |
@@ -119,6 +119,9 @@ typedef struct lua_TValue { | |||
119 | #define setnvalue(obj,x) \ | 119 | #define setnvalue(obj,x) \ |
120 | { TValue *i_o=(obj); i_o->value.n=(x); i_o->tt=LUA_TNUMBER; } | 120 | { TValue *i_o=(obj); i_o->value.n=(x); i_o->tt=LUA_TNUMBER; } |
121 | 121 | ||
122 | #define changenvalue(obj,x) \ | ||
123 | ( lua_assert((obj)->tt==LUA_TNUMBER), (obj)->value.n=(x) ) | ||
124 | |||
122 | #define setpvalue(obj,x) \ | 125 | #define setpvalue(obj,x) \ |
123 | { TValue *i_o=(obj); i_o->value.p=(x); i_o->tt=LUA_TLIGHTUSERDATA; } | 126 | { TValue *i_o=(obj); i_o->value.p=(x); i_o->tt=LUA_TLIGHTUSERDATA; } |
124 | 127 | ||