summaryrefslogtreecommitdiff
path: root/ltable.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-12-11 20:48:44 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2001-12-11 20:48:44 -0200
commit9aff171f3bf0125314a29a5ca952470b2d83708e (patch)
tree8d1b400e0108198bde554a31731c655113bc4086 /ltable.c
parented9be5e1f0d4b68aa848f85744ad959d7a57c9f4 (diff)
downloadlua-9aff171f3bf0125314a29a5ca952470b2d83708e.tar.gz
lua-9aff171f3bf0125314a29a5ca952470b2d83708e.tar.bz2
lua-9aff171f3bf0125314a29a5ca952470b2d83708e.zip
new type `boolean'
Diffstat (limited to 'ltable.c')
-rw-r--r--ltable.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ltable.c b/ltable.c
index 06e42a79..ac721f41 100644
--- a/ltable.c
+++ b/ltable.c
@@ -52,6 +52,7 @@
52#define hashnum(t,n) \ 52#define hashnum(t,n) \
53 (node(t, lmod(cast(lu_hash, cast(ls_hash, n)), sizenode(t)))) 53 (node(t, lmod(cast(lu_hash, cast(ls_hash, n)), sizenode(t))))
54#define hashstr(t,str) (node(t, lmod((str)->tsv.hash, sizenode(t)))) 54#define hashstr(t,str) (node(t, lmod((str)->tsv.hash, sizenode(t))))
55#define hashboolean(t,p) (node(t, lmod(p, sizenode(t))))
55#define hashpointer(t,p) (node(t, lmod(IntPoint(p), sizenode(t)))) 56#define hashpointer(t,p) (node(t, lmod(IntPoint(p), sizenode(t))))
56 57
57 58
@@ -65,6 +66,8 @@ Node *luaH_mainposition (const Table *t, const TObject *key) {
65 return hashnum(t, nvalue(key)); 66 return hashnum(t, nvalue(key));
66 case LUA_TSTRING: 67 case LUA_TSTRING:
67 return hashstr(t, tsvalue(key)); 68 return hashstr(t, tsvalue(key));
69 case LUA_TBOOLEAN:
70 return hashboolean(t, bvalue(key));
68 default: /* all other types are hashed as (void *) */ 71 default: /* all other types are hashed as (void *) */
69 return hashpointer(t, tsvalue(key)); 72 return hashpointer(t, tsvalue(key));
70 } 73 }