From c94f11d783f617af701429bb9ebfc7fc96d6a2d9 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 26 Jun 2014 13:17:35 -0300 Subject: 'IntPoint' -> 'point2int' + ensure that casted value fits in destination type --- llimits.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llimits.h') diff --git a/llimits.h b/llimits.h index 41f207e6..a128ae4b 100644 --- a/llimits.h +++ b/llimits.h @@ -1,5 +1,5 @@ /* -** $Id: llimits.h,v 1.115 2014/04/15 14:28:20 roberto Exp roberto $ +** $Id: llimits.h,v 1.116 2014/04/15 16:32:49 roberto Exp roberto $ ** Limits, basic types, and some other `installation-dependent' definitions ** See Copyright Notice in lua.h */ @@ -44,11 +44,11 @@ typedef unsigned char lu_byte; /* -** conversion of pointer to integer +** conversion of pointer to integer: ** this is for hashing only; there is no problem if the integer ** cannot hold the whole pointer value */ -#define IntPoint(p) ((unsigned int)(lu_mem)(p)) +#define point2int(p) ((unsigned int)((lu_mem)(p) & UINT_MAX)) -- cgit v1.2.3-55-g6feb