summaryrefslogtreecommitdiff
path: root/libguile/hash.c
diff options
context:
space:
mode:
authorMarius Vollmer <mvo@zagadka.de>2004-07-23 15:43:02 +0000
committerMarius Vollmer <mvo@zagadka.de>2004-07-23 15:43:02 +0000
commite11e83f3d99305ada6354cae7123fb8c0e998703 (patch)
tree23dccd2a0fd1741abb8561214acadc347036480b /libguile/hash.c
parent928e0f421070bb610f3375d5808a6378d5edfa1b (diff)
* deprecated.h, deprecated.c, numbers.h (SCM_INUMP, SCM_NINUMP,
SCM_INUM): Deprecated by reenaming them to SCM_I_INUMP, SCM_I_NINUMP and SCM_I_INUM, respectively and adding deprecated versions to deprecated.h and deprecated.c. Changed all uses to either use the SCM_I_ variants or scm_is_*, scm_to_*, or scm_from_*, as appropriate.
Diffstat (limited to 'libguile/hash.c')
-rw-r--r--libguile/hash.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/libguile/hash.c b/libguile/hash.c
index 18c80c0dd..4415bf82f 100644
--- a/libguile/hash.c
+++ b/libguile/hash.c
@@ -57,7 +57,7 @@ scm_hasher(SCM obj, unsigned long n, size_t d)
switch (SCM_ITAG3 (obj)) {
case scm_tc3_int_1:
case scm_tc3_int_2:
- return SCM_INUM(obj) % n; /* SCM_INUMP(obj) */
+ return SCM_I_INUM(obj) % n; /* SCM_INUMP(obj) */
case scm_tc3_imm24:
if (SCM_CHARP(obj))
return (unsigned)(scm_c_downcase(SCM_CHAR(obj))) % n;
@@ -91,20 +91,20 @@ scm_hasher(SCM obj, unsigned long n, size_t d)
case scm_tc7_number:
switch SCM_TYP16 (obj) {
case scm_tc16_big:
- return SCM_INUM (scm_modulo (obj, SCM_I_MAKINUM (n)));
+ return scm_to_ulong (scm_modulo (obj, scm_from_ulong (n)));
case scm_tc16_real:
{
double r = SCM_REAL_VALUE (obj);
- if (floor (r) == r) {
- obj = scm_inexact_to_exact (obj);
- if SCM_IMP (obj) return SCM_INUM (obj) % n;
- return SCM_INUM (scm_modulo (obj, SCM_I_MAKINUM (n)));
- }
+ if (floor (r) == r)
+ {
+ obj = scm_inexact_to_exact (obj);
+ return scm_to_ulong (scm_modulo (obj, scm_from_ulong (n)));
+ }
}
/* Fall through */
case scm_tc16_complex:
case scm_tc16_fraction:
- obj = scm_number_to_string (obj, SCM_I_MAKINUM (10));
+ obj = scm_number_to_string (obj, scm_from_int (10));
/* Fall through */
}
/* Fall through */