Mercurial > hg > xemacs-beta
comparison src/elhash.c @ 5193:41ac827cb71b
fix cygwin compile, fix warning and style in elhash.c
-------------------- ChangeLog entries follow: --------------------
src/ChangeLog addition:
2010-04-06 Ben Wing <ben@xemacs.org>
* elhash.c (Feq_hash):
Cast to EMACS_INT to fix warning.
* elhash.c (internal_hash):
* elhash.c (Feql_hash):
Fix spacing before parens.
* general-slots.h:
* xemacs.def.in.in:
Export Qfixnump to fix eldap.c link error.
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Tue, 06 Apr 2010 23:29:35 -0500 |
parents | 71ee43b8a74d |
children | 18c0b5909d16 |
comparison
equal
deleted
inserted
replaced
5192:635f4b506855 | 5193:41ac827cb71b |
---|---|
1925 internal_hash (Lisp_Object obj, int depth, Boolint equalp) | 1925 internal_hash (Lisp_Object obj, int depth, Boolint equalp) |
1926 { | 1926 { |
1927 if (depth > 5) | 1927 if (depth > 5) |
1928 return 0; | 1928 return 0; |
1929 | 1929 |
1930 if (CONSP(obj)) | 1930 if (CONSP (obj)) |
1931 { | 1931 { |
1932 Hashcode hash, h; | 1932 Hashcode hash, h; |
1933 int s; | 1933 int s; |
1934 | 1934 |
1935 depth += 1; | 1935 depth += 1; |
1936 | 1936 |
1937 if (!CONSP(XCDR(obj))) | 1937 if (!CONSP (XCDR (obj))) |
1938 { | 1938 { |
1939 /* special case for '(a . b) conses */ | 1939 /* special case for '(a . b) conses */ |
1940 return HASH2(internal_hash(XCAR(obj), depth, equalp), | 1940 return HASH2 (internal_hash (XCAR(obj), depth, equalp), |
1941 internal_hash(XCDR(obj), depth, equalp)); | 1941 internal_hash (XCDR (obj), depth, equalp)); |
1942 } | 1942 } |
1943 | 1943 |
1944 /* Don't simply tail recurse; we want to hash lists with the | 1944 /* Don't simply tail recurse; we want to hash lists with the |
1945 same contents in distinct orders differently. */ | 1945 same contents in distinct orders differently. */ |
1946 hash = internal_hash(XCAR(obj), depth, equalp); | 1946 hash = internal_hash (XCAR (obj), depth, equalp); |
1947 | 1947 |
1948 obj = XCDR(obj); | 1948 obj = XCDR (obj); |
1949 for (s = 1; s < 6 && CONSP(obj); obj = XCDR(obj), s++) | 1949 for (s = 1; s < 6 && CONSP (obj); obj = XCDR (obj), s++) |
1950 { | 1950 { |
1951 h = internal_hash(XCAR(obj), depth, equalp); | 1951 h = internal_hash (XCAR (obj), depth, equalp); |
1952 hash = HASH3(hash, h, s); | 1952 hash = HASH3 (hash, h, s); |
1953 } | 1953 } |
1954 | 1954 |
1955 return hash; | 1955 return hash; |
1956 } | 1956 } |
1957 if (STRINGP (obj)) | 1957 if (STRINGP (obj)) |
1992 DEFUN ("eq-hash", Feq_hash, 1, 1, 0, /* | 1992 DEFUN ("eq-hash", Feq_hash, 1, 1, 0, /* |
1993 Return a hash value for OBJECT appropriate for use with `eq.' | 1993 Return a hash value for OBJECT appropriate for use with `eq.' |
1994 */ | 1994 */ |
1995 (object)) | 1995 (object)) |
1996 { | 1996 { |
1997 return make_integer (XPNTRVAL (object)); | 1997 return make_integer ((EMACS_INT) XPNTRVAL (object)); |
1998 } | 1998 } |
1999 | 1999 |
2000 DEFUN ("eql-hash", Feql_hash, 1, 1, 0, /* | 2000 DEFUN ("eql-hash", Feql_hash, 1, 1, 0, /* |
2001 Return a hash value for OBJECT appropriate for use with `eql.' | 2001 Return a hash value for OBJECT appropriate for use with `eql.' |
2002 */ | 2002 */ |