# HG changeset patch # User Aidan Kehoe # Date 1261061497 0 # Node ID 0081fd36b78316a90f7f6d36eed16abb304d4e51 # Parent c69aeb86b2a3919f3e8a09bc7213ec9b3a0127dd Cast enumerations to int before comparing them for the sake of VC++. src/ChangeLog addition: 2009-12-17 Aidan Kehoe * elhash.c (HASH_TABLE_DEFAULT_REHASH_THRESHOLD): Cast the enumeration values here to integers before comparing them, fixing the build on VC++. Thank you Vin! diff -r c69aeb86b2a3 -r 0081fd36b783 src/ChangeLog --- a/src/ChangeLog Thu Dec 17 13:50:45 2009 +0000 +++ b/src/ChangeLog Thu Dec 17 14:51:37 2009 +0000 @@ -1,3 +1,9 @@ +2009-12-17 Aidan Kehoe + + * elhash.c (HASH_TABLE_DEFAULT_REHASH_THRESHOLD): + Cast the enumeration values here to integers before comparing + them, fixing the build on VC++. Thank you Vin! + 2009-12-17 Aidan Kehoe * elhash.c (HASH_TABLE_DEFAULT_REHASH_THRESHOLD): diff -r c69aeb86b2a3 -r 0081fd36b783 src/elhash.c --- a/src/elhash.c Thu Dec 17 13:50:45 2009 +0000 +++ b/src/elhash.c Thu Dec 17 14:51:37 2009 +0000 @@ -118,8 +118,12 @@ #define HASH_TABLE_DEFAULT_SIZE 16 #define HASH_TABLE_DEFAULT_REHASH_SIZE 1.3 #define HASH_TABLE_MIN_SIZE 10 -#define HASH_TABLE_DEFAULT_REHASH_THRESHOLD(size, test_function) \ - ((size) > 4096 && (test_function) == HASH_TABLE_EQ ? 0.7 : 0.6) +/* 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) #define HASHCODE(key, ht) \ ((((ht)->hash_function ? (ht)->hash_function (key) : LISP_HASH (key)) \