mirror of https://github.com/rusefi/lua.git
no more macro 'changenvalue'
This commit is contained in:
parent
ae1d318822
commit
cf160abcf9
4
lapi.c
4
lapi.c
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: lapi.c,v 2.164 2012/06/08 15:14:04 roberto Exp roberto $
|
** $Id: lapi.c,v 2.165 2012/08/14 18:12:34 roberto Exp roberto $
|
||||||
** Lua API
|
** Lua API
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -295,7 +295,7 @@ LUA_API void lua_arith (lua_State *L, int op) {
|
||||||
o1 = L->top - 2;
|
o1 = L->top - 2;
|
||||||
o2 = L->top - 1;
|
o2 = L->top - 1;
|
||||||
if (ttisnumber(o1) && ttisnumber(o2)) {
|
if (ttisnumber(o1) && ttisnumber(o2)) {
|
||||||
changenvalue(o1, luaO_arith(op, nvalue(o1), nvalue(o2)));
|
setnvalue(o1, luaO_arith(op, nvalue(o1), nvalue(o2)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
luaV_arith(L, o1, o1, o2, cast(TMS, op - LUA_OPADD + TM_ADD));
|
luaV_arith(L, o1, o1, o2, cast(TMS, op - LUA_OPADD + TM_ADD));
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
** $Id: lobject.h,v 2.69 2012/05/08 13:53:33 roberto Exp roberto $
|
** $Id: lobject.h,v 2.70 2012/05/11 14:10:50 roberto Exp roberto $
|
||||||
** Type definitions for Lua objects
|
** Type definitions for Lua objects
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
|
@ -52,8 +52,7 @@
|
||||||
#define LUA_TCCL (LUA_TFUNCTION | (2 << 4)) /* C closure */
|
#define LUA_TCCL (LUA_TFUNCTION | (2 << 4)) /* C closure */
|
||||||
|
|
||||||
|
|
||||||
/*
|
/* Variant tags for strings */
|
||||||
** LUA_TSTRING variants */
|
|
||||||
#define LUA_TSHRSTR (LUA_TSTRING | (0 << 4)) /* short strings */
|
#define LUA_TSHRSTR (LUA_TSTRING | (0 << 4)) /* short strings */
|
||||||
#define LUA_TLNGSTR (LUA_TSTRING | (1 << 4)) /* long strings */
|
#define LUA_TLNGSTR (LUA_TSTRING | (1 << 4)) /* long strings */
|
||||||
|
|
||||||
|
@ -188,8 +187,6 @@ typedef struct lua_TValue TValue;
|
||||||
#define setnvalue(obj,x) \
|
#define setnvalue(obj,x) \
|
||||||
{ TValue *io=(obj); num_(io)=(x); settt_(io, LUA_TNUMBER); }
|
{ TValue *io=(obj); num_(io)=(x); settt_(io, LUA_TNUMBER); }
|
||||||
|
|
||||||
#define changenvalue(o,x) check_exp(ttisnumber(o), num_(o)=(x))
|
|
||||||
|
|
||||||
#define setnilvalue(obj) settt_(obj, LUA_TNIL)
|
#define setnilvalue(obj) settt_(obj, LUA_TNIL)
|
||||||
|
|
||||||
#define setfvalue(obj,x) \
|
#define setfvalue(obj,x) \
|
||||||
|
|
Loading…
Reference in New Issue