mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 05:50:26 +02:00
* 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.
This commit is contained in:
parent
c81f296a08
commit
ee083ac29f
3 changed files with 21 additions and 11 deletions
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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))
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue