Mercurial > hg > xemacs-beta
comparison src/elhash.c @ 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 |
comparison
equal
deleted
inserted
replaced
4777:c69aeb86b2a3 | 4778:0081fd36b783 |
---|---|
116 (*(EMACS_UINT*)(&((htentry)->value))) = 0) | 116 (*(EMACS_UINT*)(&((htentry)->value))) = 0) |
117 | 117 |
118 #define HASH_TABLE_DEFAULT_SIZE 16 | 118 #define HASH_TABLE_DEFAULT_SIZE 16 |
119 #define HASH_TABLE_DEFAULT_REHASH_SIZE 1.3 | 119 #define HASH_TABLE_DEFAULT_REHASH_SIZE 1.3 |
120 #define HASH_TABLE_MIN_SIZE 10 | 120 #define HASH_TABLE_MIN_SIZE 10 |
121 #define HASH_TABLE_DEFAULT_REHASH_THRESHOLD(size, test_function) \ | 121 /* Casts are necessary here for VC++, though they shouldn't be. See |
122 ((size) > 4096 && (test_function) == HASH_TABLE_EQ ? 0.7 : 0.6) | 122 20a807210912170619nf13bbo8bee77a787961667@mail.gmail.com and the related |
123 thread. */ | |
124 #define HASH_TABLE_DEFAULT_REHASH_THRESHOLD(size, test_function) \ | |
125 ((size) > 4096 && ((int)(test_function)) == (int)(HASH_TABLE_EQ) \ | |
126 ? 0.7 : 0.6) | |
123 | 127 |
124 #define HASHCODE(key, ht) \ | 128 #define HASHCODE(key, ht) \ |
125 ((((ht)->hash_function ? (ht)->hash_function (key) : LISP_HASH (key)) \ | 129 ((((ht)->hash_function ? (ht)->hash_function (key) : LISP_HASH (key)) \ |
126 * (ht)->golden_ratio) \ | 130 * (ht)->golden_ratio) \ |
127 % (ht)->size) | 131 % (ht)->size) |