-rwxr-xr-x | gcl/cmpnew/gcl_cmpwt.lsp | 7 | ||||
-rwxr-xr-x | gcl/o/hash.d | 9 |
diff --git a/gcl/cmpnew/gcl_cmpwt.lsp b/gcl/cmpnew/gcl_cmpwt.lsp index 22f074989..b0dfe1f46 100755 --- a/gcl/cmpnew/gcl_cmpwt.lsp +++ b/gcl/cmpnew/gcl_cmpwt.lsp @@ -171,9 +171,10 @@ (setf (gethash x *hash-eq*) (if (> depth 3) 0 (if (typep x 'cons) - (logxor (setq depth (the fixnum (1+ depth))) - (memoized-hash-equal (car x) depth) - (memoized-hash-equal (cdr x) depth)) + (logxor (setq depth (the fixnum (1+ depth)));FIXME? + (logxor + (memoized-hash-equal (car x) depth) + (memoized-hash-equal (cdr x) depth))) (si::hash-equal x depth)))))) (defun push-data-incf (x) diff --git a/gcl/o/hash.d b/gcl/o/hash.d index c2e0383db..140c0d2e9 100755 --- a/gcl/o/hash.d +++ b/gcl/o/hash.d @@ -57,7 +57,7 @@ object sKsize; object sKrehash_size; object sKrehash_threshold; -#define MHSH(a_) ((a_) & ~(((unsigned long)1)<<(sizeof(a_)*CHAR_SIZE-1))) +#define MHSH(a_) ((a_) & ~(1UL<<(sizeof(a_)*CHAR_SIZE-1))) typedef union {/*FIXME size checks*/ float f; @@ -101,6 +101,9 @@ uarrhash(void *v,void *ve,uchar off,uchar bits) { } +#define hash_eq1(x) ufixhash((ufixnum)x/sizeof(x)) +#define hash_eq(x) MHSH(hash_eq1(x)) + static ufixnum hash_eql(object x) { @@ -151,7 +154,7 @@ hash_eql(object x) { break; default: - h=((unsigned long)x / sizeof(x)); + h=hash_eq1(x); break; } @@ -420,7 +423,7 @@ gethash(object key, object hashtable) { switch (htest) { case htt_eq: - hash_loop(eq,MHSH((long)key>>3)); + hash_loop(eq,hash_eq(key)); break; case htt_eql: hash_loop(eql,hash_eql(key)); |