mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-24 12:20:20 +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
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue