comparison src/hash.c @ 5934:e2fae7783046 cygwin

lots of use of EMACS_INT, a few others, to eliminate all pointer truncation warnings
author Henry Thompson <ht@markup.co.uk>
date Sat, 12 Dec 2015 19:08:46 +0000
parents 308d34e9f07d
children d5eb0914ca1f
comparison
equal deleted inserted replaced
5933:c1e8f3294298 5934:e2fae7783046
24 24
25 #include <config.h> 25 #include <config.h>
26 #include "lisp.h" 26 #include "lisp.h"
27 #include "hash.h" 27 #include "hash.h"
28 28
29 #define NULL_ENTRY ((void *) 0xDEADBEEF) /* -559038737 base 10 */ 29 #define NULL_ENTRY ((void *) (EMACS_UINT)0xDEADBEEF) /* -559038737 base 10 */
30 30
31 #define COMFORTABLE_SIZE(size) (21 * (size) / 16) 31 #define COMFORTABLE_SIZE(size) (21 * (size) / 16)
32 32
33 #define KEYS_DIFFER_P(old, new_, testfun) \ 33 #define KEYS_DIFFER_P(old, new_, testfun) \
34 (((old) != (new_)) && (!(testfun) || !(testfun) ((old),(new_)))) 34 (((old) != (new_)) && (!(testfun) || !(testfun) ((old),(new_))))
212 hash_table->size = hash_table_size (new_size); 212 hash_table->size = hash_table_size (new_size);
213 hash_table->harray = xnew_array (hentry, hash_table->size); 213 hash_table->harray = xnew_array (hentry, hash_table->size);
214 214
215 /* do the rehash on the "grown" table */ 215 /* do the rehash on the "grown" table */
216 { 216 {
217 long old_zero_set = hash_table->zero_set; 217 EMACS_INT old_zero_set = hash_table->zero_set;
218 void *old_zero_entry = hash_table->zero_entry; 218 void *old_zero_entry = hash_table->zero_entry;
219 clrhash (hash_table); 219 clrhash (hash_table);
220 hash_table->zero_set = old_zero_set; 220 hash_table->zero_set = old_zero_set;
221 hash_table->zero_entry = old_zero_entry; 221 hash_table->zero_entry = old_zero_entry;
222 rehash (old_harray, hash_table, old_size); 222 rehash (old_harray, hash_table, old_size);
238 puthash (const void *key, void *contents, struct hash_table *hash_table) 238 puthash (const void *key, void *contents, struct hash_table *hash_table)
239 { 239 {
240 if (!key) 240 if (!key)
241 { 241 {
242 hash_table->zero_entry = contents; 242 hash_table->zero_entry = contents;
243 hash_table->zero_set = 1; 243 hash_table->zero_set = (EMACS_INT)1;
244 } 244 }
245 else 245 else
246 { 246 {
247 hash_table_test_function test_function = hash_table->test_function; 247 hash_table_test_function test_function = hash_table->test_function;
248 Elemcount size = hash_table->size; 248 Elemcount size = hash_table->size;