diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-12-11 20:48:44 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-12-11 20:48:44 -0200 |
commit | 9aff171f3bf0125314a29a5ca952470b2d83708e (patch) | |
tree | 8d1b400e0108198bde554a31731c655113bc4086 /ltable.c | |
parent | ed9be5e1f0d4b68aa848f85744ad959d7a57c9f4 (diff) | |
download | lua-9aff171f3bf0125314a29a5ca952470b2d83708e.tar.gz lua-9aff171f3bf0125314a29a5ca952470b2d83708e.tar.bz2 lua-9aff171f3bf0125314a29a5ca952470b2d83708e.zip |
new type `boolean'
Diffstat (limited to 'ltable.c')
-rw-r--r-- | ltable.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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 | } |