aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-06-18 13:36:40 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-06-18 13:36:40 -0300
commita36c8e1718fd32ea99e29797e5124600a16ccc03 (patch)
treec7afa61e6da049ac87babb03bcc3ef736e6ff402
parentd7872dcf91eb2075312a03973a6cdb489610c796 (diff)
downloadlua-a36c8e1718fd32ea99e29797e5124600a16ccc03.tar.gz
lua-a36c8e1718fd32ea99e29797e5124600a16ccc03.tar.bz2
lua-a36c8e1718fd32ea99e29797e5124600a16ccc03.zip
new macro 'changenvalue'
-rw-r--r--lobject.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/lobject.h b/lobject.h
index cd019899..62c5cb21 100644
--- a/lobject.h
+++ b/lobject.h
@@ -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