aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--llimits.h6
-rw-r--r--ltable.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/llimits.h b/llimits.h
index 41f207e6..a128ae4b 100644
--- a/llimits.h
+++ b/llimits.h
@@ -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
diff --git a/ltable.c b/ltable.c
index 3a80d9d0..712b9814 100644
--- a/ltable.c
+++ b/ltable.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ltable.c,v 2.89 2014/05/26 17:10:22 roberto Exp roberto $ 2** $Id: ltable.c,v 2.90 2014/06/18 22:59:29 roberto Exp roberto $
3** Lua tables (hash) 3** Lua tables (hash)
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -64,7 +64,7 @@
64#define hashmod(t,n) (gnode(t, ((n) % ((sizenode(t)-1)|1)))) 64#define hashmod(t,n) (gnode(t, ((n) % ((sizenode(t)-1)|1))))
65 65
66 66
67#define hashpointer(t,p) hashmod(t, IntPoint(p)) 67#define hashpointer(t,p) hashmod(t, point2int(p))
68 68
69 69
70#define dummynode (&dummynode_) 70#define dummynode (&dummynode_)