diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-06-26 13:17:35 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2014-06-26 13:17:35 -0300 |
commit | c94f11d783f617af701429bb9ebfc7fc96d6a2d9 (patch) | |
tree | 0fd802c96a615ef857806debc08aa583f7a9bf24 /llimits.h | |
parent | 54ac5960a800c32d7d9824d15b14a31131301678 (diff) | |
download | lua-c94f11d783f617af701429bb9ebfc7fc96d6a2d9.tar.gz lua-c94f11d783f617af701429bb9ebfc7fc96d6a2d9.tar.bz2 lua-c94f11d783f617af701429bb9ebfc7fc96d6a2d9.zip |
'IntPoint' -> 'point2int' + ensure that casted value fits in
destination type
Diffstat (limited to 'llimits.h')
-rw-r--r-- | llimits.h | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: llimits.h,v 1.115 2014/04/15 14:28:20 roberto Exp roberto $ | 2 | ** $Id: llimits.h,v 1.116 2014/04/15 16:32:49 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 | */ |
@@ -44,11 +44,11 @@ typedef unsigned char lu_byte; | |||
44 | 44 | ||
45 | 45 | ||
46 | /* | 46 | /* |
47 | ** conversion of pointer to integer | 47 | ** conversion of pointer to integer: |
48 | ** this is for hashing only; there is no problem if the integer | 48 | ** this is for hashing only; there is no problem if the integer |
49 | ** cannot hold the whole pointer value | 49 | ** cannot hold the whole pointer value |
50 | */ | 50 | */ |
51 | #define IntPoint(p) ((unsigned int)(lu_mem)(p)) | 51 | #define point2int(p) ((unsigned int)((lu_mem)(p) & UINT_MAX)) |
52 | 52 | ||
53 | 53 | ||
54 | 54 | ||