'point2int' -> 'point2uint' (to reflect its actual result type)

This commit is contained in:
Roberto Ierusalimschy 2015-03-03 16:53:13 -03:00
parent b9a1f27250
commit a00013c8d0
2 changed files with 5 additions and 5 deletions

View File

@ -1,5 +1,5 @@
/* /*
** $Id: llimits.h,v 1.130 2015/02/05 17:15:33 roberto Exp roberto $ ** $Id: llimits.h,v 1.131 2015/02/09 15:41:56 roberto Exp roberto $
** Limits, basic types, and some other 'installation-dependent' definitions ** Limits, basic types, and some other 'installation-dependent' definitions
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -52,11 +52,11 @@ typedef unsigned char lu_byte;
/* /*
** conversion of pointer to integer: ** conversion of pointer to unsigned integer:
** this is for hashing only; there is no problem if the integer ** this is for hashing only; there is no problem if the integer
** cannot hold the whole pointer value ** cannot hold the whole pointer value
*/ */
#define point2int(p) ((unsigned int)((size_t)(p) & UINT_MAX)) #define point2uint(p) ((unsigned int)((size_t)(p) & UINT_MAX))

View File

@ -1,5 +1,5 @@
/* /*
** $Id: ltable.c,v 2.104 2015/02/20 14:05:01 roberto Exp roberto $ ** $Id: ltable.c,v 2.105 2015/02/20 14:27:53 roberto Exp roberto $
** Lua tables (hash) ** Lua tables (hash)
** See Copyright Notice in lua.h ** See Copyright Notice in lua.h
*/ */
@ -70,7 +70,7 @@
#define hashmod(t,n) (gnode(t, ((n) % ((sizenode(t)-1)|1)))) #define hashmod(t,n) (gnode(t, ((n) % ((sizenode(t)-1)|1))))
#define hashpointer(t,p) hashmod(t, point2int(p)) #define hashpointer(t,p) hashmod(t, point2uint(p))
#define dummynode (&dummynode_) #define dummynode (&dummynode_)