From 037a70dfea9de66e8d27c8d3ce2ed9f159a1b094 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 15 Apr 2014 13:32:49 -0300 Subject: cast_u2s/cast_s2u renamed l_castS2U/l_castU2S to be configurable from outside (mostly for testing) --- lobject.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lobject.c') diff --git a/lobject.c b/lobject.c index c736c8a8..2c437527 100644 --- a/lobject.c +++ b/lobject.c @@ -1,5 +1,5 @@ /* -** $Id: lobject.c,v 2.78 2014/04/11 19:52:26 roberto Exp roberto $ +** $Id: lobject.c,v 2.79 2014/04/15 14:28:20 roberto Exp roberto $ ** Some generic functions over Lua objects ** See Copyright Notice in lua.h */ @@ -85,7 +85,7 @@ static lua_Integer intarith (lua_State *L, int op, lua_Integer v1, case LUA_OPSHL: return luaV_shiftl(v1, v2); case LUA_OPSHR: return luaV_shiftl(v1, -v2); case LUA_OPUNM: return intop(-, 0, v1); - case LUA_OPBNOT: return intop(^, ~cast_s2u(0), v1); + case LUA_OPBNOT: return intop(^, ~l_castS2U(0), v1); default: lua_assert(0); return 0; } } @@ -291,7 +291,7 @@ int luaO_str2int (const char *s, size_t len, lua_Integer *result) { while (lisspace(cast_uchar(*s))) s++; /* skip trailing spaces */ if (empty || s != ends) return 0; /* something wrong in the numeral */ else { - *result = cast_u2s((neg) ? 0u - a : a); + *result = l_castU2S((neg) ? 0u - a : a); return 1; } } -- cgit v1.2.3-55-g6feb