changeset 4779:fd98353950a4

Make my last change to elhash.c more kosher, comparing pointers not ints 2009-12-17 Aidan Kehoe <kehoea@parhasard.net> * elhash.c (HASH_TABLE_DEFAULT_REHASH_THRESHOLD): That last change was wrong in theory though not in practice; we're comparing function pointers, not enumeration values.
author Aidan Kehoe <kehoea@parhasard.net>
date Thu, 17 Dec 2009 17:29:32 +0000
parents 0081fd36b783
children 2fd201d73a92
files src/ChangeLog src/elhash.c
diffstat 2 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Thu Dec 17 14:51:37 2009 +0000
+++ b/src/ChangeLog	Thu Dec 17 17:29:32 2009 +0000
@@ -1,3 +1,9 @@
+2009-12-17  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* elhash.c (HASH_TABLE_DEFAULT_REHASH_THRESHOLD): 
+	That last change was wrong in theory though not in practice; we're
+	comparing function pointers, not enumeration values.
+
 2009-12-17  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* elhash.c (HASH_TABLE_DEFAULT_REHASH_THRESHOLD):
--- a/src/elhash.c	Thu Dec 17 14:51:37 2009 +0000
+++ b/src/elhash.c	Thu Dec 17 17:29:32 2009 +0000
@@ -118,12 +118,8 @@
 #define HASH_TABLE_DEFAULT_SIZE 16
 #define HASH_TABLE_DEFAULT_REHASH_SIZE 1.3
 #define HASH_TABLE_MIN_SIZE 10
-/* Casts are necessary here for VC++, though they shouldn't be. See
-   20a807210912170619nf13bbo8bee77a787961667@mail.gmail.com and the related
-   thread.  */
 #define HASH_TABLE_DEFAULT_REHASH_THRESHOLD(size, test_function)   \
-  ((size) > 4096 && ((int)(test_function)) == (int)(HASH_TABLE_EQ) \
-   ? 0.7 : 0.6)
+  (((size) > 4096 && NULL == (test_function)) ? 0.7 : 0.6)
 
 #define HASHCODE(key, ht)						\
   ((((ht)->hash_function ? (ht)->hash_function (key) : LISP_HASH (key))	\