summaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2011-12-14 17:14:29 -0800
committerKaz Kylheku <kaz@kylheku.com>2011-12-14 17:14:29 -0800
commit93e4c50d09dcc20d7b244b66987f869143d45dd0 (patch)
tree83a176f4793df2dbfcf195b0649290cf8b3986c2 /hash.c
parent311294aef85c349ee71c3925a52d0888073a1fa0 (diff)
downloadtxr-93e4c50d09dcc20d7b244b66987f869143d45dd0.tar.gz
txr-93e4c50d09dcc20d7b244b66987f869143d45dd0.tar.bz2
txr-93e4c50d09dcc20d7b244b66987f869143d45dd0.zip
* eval.c (eval_init): Removed registration for vec_get_fil.
Renamed vec_set_fill to vec-set-length. * hash.c (equal_hash): vec_fill to vec_length name change. (hash_grow, make_hash): No need to call vec_set_length. * lib.c (equal, vecref, vec_push, length_vec, list_vector, obj_print, obj_pprint): vec_fill to vec_length name change. (vector): Argument now represents actual length, not just allocated size. (vec_get_fill): Function removed; did exactly the same thing as length_vec. (vec_set_fill): Function renamed to vec_set_length. (vector_list): Allocate a 0 length vector initially. * lib.h (enum vecindex): member changes name from vec_fill to vec_length. (vector): Parameter name changed. (vec_set_fill): Redeclared. (vec_get_fill): Declaration removed. * txr.1: Doc stubs updated.
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/hash.c b/hash.c
index 892dfa5c..db7be842 100644
--- a/hash.c
+++ b/hash.c
@@ -117,9 +117,9 @@ static cnum equal_hash(val obj)
return ((cnum) obj->f.f.interp_fun + equal_hash(obj->f.env)) & NUM_MAX;
case VEC:
{
- val fill = obj->v.vec[vec_fill];
- cnum i, h = equal_hash(obj->v.vec[vec_fill]);
- cnum len = c_num(fill);
+ val length = obj->v.vec[vec_length];
+ cnum i, h = equal_hash(obj->v.vec[vec_length]);
+ cnum len = c_num(length);
for (i = 0; i < len; i++)
h = (h + equal_hash(obj->v.vec[i])) & NUM_MAX;
@@ -228,8 +228,6 @@ static void hash_grow(struct hash *h)
bug_unless (new_modulus > h->modulus);
- vec_set_fill(new_table, num(new_modulus));
-
for (i = 0; i < h->modulus; i++) {
val conses = *vecref_l(h->table, num(i));
@@ -256,8 +254,6 @@ val make_hash(val weak_keys, val weak_vals, val equal_based)
val table = vector(mod);
val hash = cobj((mem_t *) h, hash_s, &hash_ops);
- vec_set_fill(table, mod);
-
h->flags = (hash_flags_t) flags;
h->modulus = c_num(mod);
h->count = 0;