mirror of
https://github.com/lua/lua
synced 2025-01-21 00:22:04 +03:00
avoid warning for unary minus over an unsigned value
This commit is contained in:
parent
7c4cc505db
commit
d6f5fb2d2c
4
lapi.c
4
lapi.c
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lapi.c,v 2.182 2013/06/14 18:32:45 roberto Exp roberto $
|
||||
** $Id: lapi.c,v 2.183 2013/06/20 15:02:49 roberto Exp roberto $
|
||||
** Lua API
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -399,7 +399,7 @@ LUA_API lua_Unsigned lua_tounsignedx (lua_State *L, int idx, int *pisnum) {
|
||||
if (luai_numisnan(L,n)) /* not a number? */
|
||||
break; /* not an integer, too */
|
||||
res = cast_unsigned(n);
|
||||
if (neg) res = -res;
|
||||
if (neg) res = 0u - res;
|
||||
isnum = 1;
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user