diff options
author | Marius Vollmer <mvo@zagadka.de> | 2004-07-23 15:43:02 +0000 |
---|---|---|
committer | Marius Vollmer <mvo@zagadka.de> | 2004-07-23 15:43:02 +0000 |
commit | e11e83f3d99305ada6354cae7123fb8c0e998703 (patch) | |
tree | 23dccd2a0fd1741abb8561214acadc347036480b /libguile/objects.c | |
parent | 928e0f421070bb610f3375d5808a6378d5edfa1b (diff) | |
download | guile-e11e83f3d99305ada6354cae7123fb8c0e998703.tar.gz |
* 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/objects.c')
-rw-r--r-- | libguile/objects.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/libguile/objects.c b/libguile/objects.c index f999a4f37..ca5c2c29f 100644 --- a/libguile/objects.c +++ b/libguile/objects.c @@ -234,18 +234,25 @@ SCM_DEFINE (scm_class_of, "class-of", 1, 0, 0, SCM scm_mcache_lookup_cmethod (SCM cache, SCM args) { - long i, n, end, mask; + unsigned long i, mask, n, end; SCM ls, methods, z = SCM_CDDR (cache); - n = SCM_INUM (SCM_CAR (z)); /* maximum number of specializers */ + n = scm_to_ulong (SCM_CAR (z)); /* maximum number of specializers */ methods = SCM_CADR (z); - if (SCM_INUMP (methods)) + if (SCM_VECTORP (methods)) + { + /* cache format #1: prepare for linear search */ + mask = -1; + i = 0; + end = SCM_VECTOR_LENGTH (methods); + } + else { /* cache format #2: compute a hash value */ - long hashset = SCM_INUM (methods); + unsigned long hashset = scm_to_ulong (methods); long j = n; z = SCM_CDDR (z); - mask = SCM_INUM (SCM_CAR (z)); + mask = scm_to_ulong (SCM_CAR (z)); methods = SCM_CADR (z); i = 0; ls = args; @@ -260,13 +267,6 @@ scm_mcache_lookup_cmethod (SCM cache, SCM args) i &= mask; end = i; } - else /* SCM_VECTORP (methods) */ - { - /* cache format #1: prepare for linear search */ - mask = -1; - i = 0; - end = SCM_VECTOR_LENGTH (methods); - } /* Search for match */ do |