diff options
author | Dirk Herrmann <dirk@dirk-herrmanns-seiten.de> | 2001-10-08 21:23:00 +0000 |
---|---|---|
committer | Dirk Herrmann <dirk@dirk-herrmanns-seiten.de> | 2001-10-08 21:23:00 +0000 |
commit | ee083ac29f32c5657f02fae999701310bd7da7bf (patch) | |
tree | 85f677290cfa21e043307ddac056b7379436884c | |
parent | c81f296a087281bab5a8708b2b16966e328c2363 (diff) |
* hashtab.c (scm_hash_fn_create_handle_x): The result of assoc_fn
is known to be #f if no entry is found. Thus, use !SCM_FALSEP
instead of SCM_NIMP to test for that case.
* strings.h (SCM_SET_STRING_LENGTH): Cast the length to
scm_t_bits instead of long.
-rw-r--r-- | libguile/ChangeLog | 9 | ||||
-rw-r--r-- | libguile/hashtab.c | 21 | ||||
-rw-r--r-- | libguile/strings.h | 2 |
3 files changed, 21 insertions, 11 deletions
diff --git a/libguile/ChangeLog b/libguile/ChangeLog index cca0c7b84..9c76c0f6a 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,12 @@ +2001-10-08 Dirk Herrmann <D.Herrmann@tu-bs.de> + + * hashtab.c (scm_hash_fn_create_handle_x): The result of assoc_fn + is known to be #f if no entry is found. Thus, use !SCM_FALSEP + instead of SCM_NIMP to test for that case. + + * strings.h (SCM_SET_STRING_LENGTH): Cast the length to + scm_t_bits instead of long. + 2001-10-06 Marius Vollmer <mvo@zagadka.ping.de> * tags.h (SCM_T_BITS_MAX, SCM_T_SIGNED_BITS_MAX, diff --git a/libguile/hashtab.c b/libguile/hashtab.c index ca06b2030..dc5545390 100644 --- a/libguile/hashtab.c +++ b/libguile/hashtab.c @@ -96,20 +96,21 @@ scm_hash_fn_create_handle_x (SCM table,SCM obj,SCM init,unsigned long (*hash_fn) scm_out_of_range ("hash_fn_create_handle_x", scm_ulong2num (k)); SCM_REDEFER_INTS; it = assoc_fn (obj, SCM_VELTS (table)[k], closure); - if (SCM_NIMP (it)) + if (!SCM_FALSEP (it)) { SCM_REALLOW_INTS; return it; } - { - SCM new_bucket; - SCM old_bucket; - old_bucket = SCM_VELTS (table)[k]; - new_bucket = scm_acons (obj, init, old_bucket); - SCM_VELTS(table)[k] = new_bucket; - SCM_REALLOW_INTS; - return SCM_CAR (new_bucket); - } + else + { + SCM new_bucket; + SCM old_bucket; + old_bucket = SCM_VELTS (table)[k]; + new_bucket = scm_acons (obj, init, old_bucket); + SCM_VELTS(table)[k] = new_bucket; + SCM_REALLOW_INTS; + return SCM_CAR (new_bucket); + } } #undef FUNC_NAME diff --git a/libguile/strings.h b/libguile/strings.h index 271497a5d..2c943d17c 100644 --- a/libguile/strings.h +++ b/libguile/strings.h @@ -56,7 +56,7 @@ #define SCM_SET_STRING_CHARS(s, c) (SCM_SET_CELL_WORD_1 ((s), (c))) #define SCM_STRING_MAX_LENGTH ((1UL << 24) - 1UL) #define SCM_STRING_LENGTH(x) ((size_t) (SCM_CELL_WORD_0 (x) >> 8)) -#define SCM_SET_STRING_LENGTH(s, l) (SCM_SET_CELL_WORD_0 ((s), (((long) (l)) << 8) + scm_tc7_string)) +#define SCM_SET_STRING_LENGTH(s, l) (SCM_SET_CELL_WORD_0 ((s), (((scm_t_bits) (l)) << 8) + scm_tc7_string)) |