1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-06 04:00:26 +02:00

MinGW 64: fixes hash out-of-range error for 64-bit negative numbers

* libguile/hash.c (scm_raw_ihash): modified
This commit is contained in:
Michael Gran 2022-10-16 01:24:48 -07:00
parent eec610141b
commit 46bb667f20

View file

@ -301,7 +301,7 @@ scm_raw_ihash (SCM obj, size_t depth)
SCM n = SCM_I_MAKINUM (SCM_MOST_POSITIVE_FIXNUM); SCM n = SCM_I_MAKINUM (SCM_MOST_POSITIVE_FIXNUM);
if (scm_is_inexact (obj)) if (scm_is_inexact (obj))
obj = scm_inexact_to_exact (obj); obj = scm_inexact_to_exact (obj);
return scm_raw_ihashq (scm_to_ulong (scm_modulo (obj, n))); return scm_raw_ihashq (scm_to_uintptr_t (scm_modulo (obj, n)));
} }
else else
return scm_i_string_hash (scm_number_to_string (obj, scm_from_int (10))); return scm_i_string_hash (scm_number_to_string (obj, scm_from_int (10)));