diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-02-26 09:38:43 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-02-26 09:38:43 -0300 |
commit | 11e762dbcd5400b2d53af51cd21ac681f25b9585 (patch) | |
tree | bd57d0a9aeb9003ab7435e520642b26048c5a29a | |
parent | 5c9cb5f0b108435204d03f5b282dff8a18665b4b (diff) | |
download | lua-11e762dbcd5400b2d53af51cd21ac681f25b9585.tar.gz lua-11e762dbcd5400b2d53af51cd21ac681f25b9585.tar.bz2 lua-11e762dbcd5400b2d53af51cd21ac681f25b9585.zip |
added macro MAX_UINTEGER
-rw-r--r-- | llimits.h | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llimits.h,v 1.108 2013/06/19 14:27:00 roberto Exp roberto $ | 2 | ** $Id: llimits.h,v 1.109 2013/08/21 19:02:30 roberto Exp roberto $ |
3 | ** Limits, basic types, and some other `installation-dependent' definitions | 3 | ** Limits, basic types, and some other `installation-dependent' definitions |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -43,11 +43,13 @@ typedef unsigned char lu_byte; | |||
43 | #define MAX_INT (INT_MAX-2) /* maximum value of an int (-2 for safety) */ | 43 | #define MAX_INT (INT_MAX-2) /* maximum value of an int (-2 for safety) */ |
44 | 44 | ||
45 | 45 | ||
46 | /* maximum value for a lua_Unsigned */ | ||
47 | #define MAX_UINTEGER (~(lua_Unsigned)0) | ||
48 | |||
46 | /* minimum and maximum values for lua_Integer */ | 49 | /* minimum and maximum values for lua_Integer */ |
47 | #define MAX_INTEGER ((lua_Integer)(~(lua_Unsigned)0 >> 1)) | 50 | #define MAX_INTEGER ((lua_Integer)(MAX_UINTEGER >> 1)) |
48 | #define MIN_INTEGER (~MAX_INTEGER) | 51 | #define MIN_INTEGER (~MAX_INTEGER) |
49 | 52 | ||
50 | |||
51 | /* | 53 | /* |
52 | ** conversion of pointer to integer | 54 | ** conversion of pointer to integer |
53 | ** this is for hashing only; there is no problem if the integer | 55 | ** this is for hashing only; there is no problem if the integer |