Mercurial > hg > xemacs-beta
changeset 4778:0081fd36b783
Cast enumerations to int before comparing them for the sake of VC++.
src/ChangeLog addition:
2009-12-17 Aidan Kehoe <kehoea@parhasard.net>
* 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!
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Thu, 17 Dec 2009 14:51:37 +0000 |
parents | c69aeb86b2a3 |
children | fd98353950a4 |
files | src/ChangeLog src/elhash.c |
diffstat | 2 files changed, 12 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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 <kehoea@parhasard.net> + + * 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 <kehoea@parhasard.net> * elhash.c (HASH_TABLE_DEFAULT_REHASH_THRESHOLD):
--- 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)) \