aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2012-09-11 15:21:44 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2012-09-11 15:21:44 -0300
commitcf160abcf9f7d42d1acf841f7720cb8c2baa5e3c (patch)
tree77f81a3f816d31131e80083851563bdeedf9cf31
parentae1d318822c2b531aa69ac0dfed1edc6470f6200 (diff)
downloadlua-cf160abcf9f7d42d1acf841f7720cb8c2baa5e3c.tar.gz
lua-cf160abcf9f7d42d1acf841f7720cb8c2baa5e3c.tar.bz2
lua-cf160abcf9f7d42d1acf841f7720cb8c2baa5e3c.zip
no more macro 'changenvalue'
-rw-r--r--lapi.c4
-rw-r--r--lobject.h7
2 files changed, 4 insertions, 7 deletions
diff --git a/lapi.c b/lapi.c
index 066f4152..0468f34b 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 2.164 2012/06/08 15:14:04 roberto Exp roberto $ 2** $Id: lapi.c,v 2.165 2012/08/14 18:12:34 roberto Exp roberto $
3** Lua API 3** Lua API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -295,7 +295,7 @@ LUA_API void lua_arith (lua_State *L, int op) {
295 o1 = L->top - 2; 295 o1 = L->top - 2;
296 o2 = L->top - 1; 296 o2 = L->top - 1;
297 if (ttisnumber(o1) && ttisnumber(o2)) { 297 if (ttisnumber(o1) && ttisnumber(o2)) {
298 changenvalue(o1, luaO_arith(op, nvalue(o1), nvalue(o2))); 298 setnvalue(o1, luaO_arith(op, nvalue(o1), nvalue(o2)));
299 } 299 }
300 else 300 else
301 luaV_arith(L, o1, o1, o2, cast(TMS, op - LUA_OPADD + TM_ADD)); 301 luaV_arith(L, o1, o1, o2, cast(TMS, op - LUA_OPADD + TM_ADD));
diff --git a/lobject.h b/lobject.h
index 1d29a22c..ba9e41dc 100644
--- a/lobject.h
+++ b/lobject.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lobject.h,v 2.69 2012/05/08 13:53:33 roberto Exp roberto $ 2** $Id: lobject.h,v 2.70 2012/05/11 14:10:50 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*/
@@ -52,8 +52,7 @@
52#define LUA_TCCL (LUA_TFUNCTION | (2 << 4)) /* C closure */ 52#define LUA_TCCL (LUA_TFUNCTION | (2 << 4)) /* C closure */
53 53
54 54
55/* 55/* Variant tags for strings */
56** LUA_TSTRING variants */
57#define LUA_TSHRSTR (LUA_TSTRING | (0 << 4)) /* short strings */ 56#define LUA_TSHRSTR (LUA_TSTRING | (0 << 4)) /* short strings */
58#define LUA_TLNGSTR (LUA_TSTRING | (1 << 4)) /* long strings */ 57#define LUA_TLNGSTR (LUA_TSTRING | (1 << 4)) /* long strings */
59 58
@@ -188,8 +187,6 @@ typedef struct lua_TValue TValue;
188#define setnvalue(obj,x) \ 187#define setnvalue(obj,x) \
189 { TValue *io=(obj); num_(io)=(x); settt_(io, LUA_TNUMBER); } 188 { TValue *io=(obj); num_(io)=(x); settt_(io, LUA_TNUMBER); }
190 189
191#define changenvalue(o,x) check_exp(ttisnumber(o), num_(o)=(x))
192
193#define setnilvalue(obj) settt_(obj, LUA_TNIL) 190#define setnilvalue(obj) settt_(obj, LUA_TNIL)
194 191
195#define setfvalue(obj,x) \ 192#define setfvalue(obj,x) \