macro 'nvalue' removed + cast to void added to avoid warnings
with 'clang'
This commit is contained in:
13
lvm.c
13
lvm.c
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lvm.c,v 2.167 2013/04/29 17:12:50 roberto Exp roberto $
|
** $Id: lvm.c,v 2.168 2013/05/02 12:31:26 roberto Exp roberto $
|
||||||
** Lua virtual machine
|
** Lua virtual machine
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@@ -48,9 +48,11 @@ int luaV_tostring (lua_State *L, StkId obj) {
|
|||||||
return 0;
|
return 0;
|
||||||
else {
|
else {
|
||||||
char s[LUAI_MAXNUMBER2STR];
|
char s[LUAI_MAXNUMBER2STR];
|
||||||
lua_Number n = nvalue(obj);
|
lua_Number n;
|
||||||
int l = lua_number2str(s, n);
|
int len;
|
||||||
setsvalue2s(L, obj, luaS_newlstr(L, s, l));
|
(void)tonumber(obj, &n);
|
||||||
|
len = lua_number2str(s, n);
|
||||||
|
setsvalue2s(L, obj, luaS_newlstr(L, s, len));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -207,7 +209,8 @@ int luaV_equalobj (lua_State *L, const TValue *t1, const TValue *t2) {
|
|||||||
return 0; /* only numbers can be equal with different variants */
|
return 0; /* only numbers can be equal with different variants */
|
||||||
else { /* two numbers with different variants */
|
else { /* two numbers with different variants */
|
||||||
lua_Number n1, n2;
|
lua_Number n1, n2;
|
||||||
tonumber(t1, &n1); tonumber(t2, &n2);
|
lua_assert(ttisnumber(t1) && ttisnumber(t2));
|
||||||
|
(void)tonumber(t1, &n1); (void)tonumber(t2, &n2);
|
||||||
return luai_numeq(n1, n2);
|
return luai_numeq(n1, n2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user