diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-04-12 11:45:10 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-04-12 11:45:10 -0300 |
commit | ef789d4161b6f2b6c28c28c71268a591e9ec6d42 (patch) | |
tree | 4c5f4ddcf0c9ab3f75e05e270c341ff3826724c6 /lstrlib.c | |
parent | b390d7c168ac85f5cef85b6a2a5716e5fde388a8 (diff) | |
download | lua-ef789d4161b6f2b6c28c28c71268a591e9ec6d42.tar.gz lua-ef789d4161b6f2b6c28c28c71268a591e9ec6d42.tar.bz2 lua-ef789d4161b6f2b6c28c28c71268a591e9ec6d42.zip |
new global macro 'LUA_MAXUNSIGNED'
Diffstat (limited to 'lstrlib.c')
-rw-r--r-- | lstrlib.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstrlib.c,v 1.193 2014/04/10 18:24:12 roberto Exp roberto $ | 2 | ** $Id: lstrlib.c,v 1.194 2014/04/10 19:45:43 roberto Exp roberto $ |
3 | ** Standard library for string operations and pattern-matching | 3 | ** Standard library for string operations and pattern-matching |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -1008,7 +1008,7 @@ static int dumpint (char *buff, lua_Unsigned n, int littleendian, int size) { | |||
1008 | /* OK if there are only zeros left in higher bytes, | 1008 | /* OK if there are only zeros left in higher bytes, |
1009 | or only ones left (excluding non-signal bits in last byte) */ | 1009 | or only ones left (excluding non-signal bits in last byte) */ |
1010 | return ((n & ~(lua_Integer)MC) == 0 || | 1010 | return ((n & ~(lua_Integer)MC) == 0 || |
1011 | (n | SM) == (~(lua_Unsigned)0 >> ((size - 1) * NB))); | 1011 | (n | SM) == (LUA_MAXUNSIGNED >> ((size - 1) * NB))); |
1012 | } | 1012 | } |
1013 | else return 1; /* no overflow can occur with full size */ | 1013 | else return 1; /* no overflow can occur with full size */ |
1014 | } | 1014 | } |