From d6f5fb2d2c5cfeab1e0aaddac7f121a909eb9408 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 20 Jun 2013 12:12:43 -0300 Subject: avoid warning for unary minus over an unsigned value --- lapi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lapi.c') diff --git a/lapi.c b/lapi.c index 51f782f0..e8e7104f 100644 --- a/lapi.c +++ b/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; } -- cgit v1.2.3-55-g6feb