diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-04-15 11:29:30 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-04-15 11:29:30 -0300 |
| commit | 8f961da3dbf8c45389d1431e6dff8e44e41f1a57 (patch) | |
| tree | ee67fa31c29eab0569c35c62b17f43092f60d940 /lobject.c | |
| parent | 5c46b7b8cf3a71cce5572b1fca84542e24723efd (diff) | |
| download | lua-8f961da3dbf8c45389d1431e6dff8e44e41f1a57.tar.gz lua-8f961da3dbf8c45389d1431e6dff8e44e41f1a57.tar.bz2 lua-8f961da3dbf8c45389d1431e6dff8e44e41f1a57.zip | |
macros cast_integer/cast_unsigned replaced by cast_u2s/cast_s2u, that
should be used only between lua_Integer and lua_Unsigned
Diffstat (limited to 'lobject.c')
| -rw-r--r-- | lobject.c | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lobject.c,v 2.77 2014/04/09 17:05:11 roberto Exp roberto $ | 2 | ** $Id: lobject.c,v 2.78 2014/04/11 19:52:26 roberto Exp roberto $ |
| 3 | ** Some generic functions over Lua objects | 3 | ** Some generic functions over Lua objects |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -85,7 +85,7 @@ static lua_Integer intarith (lua_State *L, int op, lua_Integer v1, | |||
| 85 | case LUA_OPSHL: return luaV_shiftl(v1, v2); | 85 | case LUA_OPSHL: return luaV_shiftl(v1, v2); |
| 86 | case LUA_OPSHR: return luaV_shiftl(v1, -v2); | 86 | case LUA_OPSHR: return luaV_shiftl(v1, -v2); |
| 87 | case LUA_OPUNM: return intop(-, 0, v1); | 87 | case LUA_OPUNM: return intop(-, 0, v1); |
| 88 | case LUA_OPBNOT: return intop(^, cast_integer(-1), v1); | 88 | case LUA_OPBNOT: return intop(^, ~cast_s2u(0), v1); |
| 89 | default: lua_assert(0); return 0; | 89 | default: lua_assert(0); return 0; |
| 90 | } | 90 | } |
| 91 | } | 91 | } |
| @@ -291,7 +291,7 @@ int luaO_str2int (const char *s, size_t len, lua_Integer *result) { | |||
| 291 | while (lisspace(cast_uchar(*s))) s++; /* skip trailing spaces */ | 291 | while (lisspace(cast_uchar(*s))) s++; /* skip trailing spaces */ |
| 292 | if (empty || s != ends) return 0; /* something wrong in the numeral */ | 292 | if (empty || s != ends) return 0; /* something wrong in the numeral */ |
| 293 | else { | 293 | else { |
| 294 | *result = cast_integer((neg) ? 0u - a : a); | 294 | *result = cast_u2s((neg) ? 0u - a : a); |
| 295 | return 1; | 295 | return 1; |
| 296 | } | 296 | } |
| 297 | } | 297 | } |
| @@ -346,7 +346,7 @@ const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp) { | |||
| 346 | break; | 346 | break; |
| 347 | } | 347 | } |
| 348 | case 'I': { | 348 | case 'I': { |
| 349 | setivalue(L->top++, cast_integer(va_arg(argp, l_uacInt))); | 349 | setivalue(L->top++, cast(lua_Integer, va_arg(argp, l_uacInt))); |
| 350 | break; | 350 | break; |
| 351 | } | 351 | } |
| 352 | case 'f': { | 352 | case 'f': { |
