From f1a8ce9fda66ec5a3295a4b79ff3f3ec0195d994 Mon Sep 17 00:00:00 2001 From: hunt Date: Wed, 18 May 2005 00:25:31 +0000 Subject: 2005-05-17 Martin Hunt * map.c (needed_space): Use do_div(). (_stp_map_print_histogram): Ditto. (_stp_map_print): Ditto. * map-values.c (_stp_map_add_int64_stat): Use do_div() when computing histogram bucket. * map-keys.c (_stp_map_key): Fix some warnings on 32-bit machines by using key_data casts. --- runtime/map-keys.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'runtime/map-keys.c') diff --git a/runtime/map-keys.c b/runtime/map-keys.c index 37308179..b51118ec 100644 --- a/runtime/map-keys.c +++ b/runtime/map-keys.c @@ -323,14 +323,6 @@ MAP KEYSYM(_stp_map_new) (unsigned max_entries, int valtype, ...) } -#define SETKEYS2(key, n) { \ - if (__builtin_types_compatible_p (typeof (key), char[])) { \ - map->c_key[n].strp = (char *)key; \ - } else { \ - map->c_key[n].val = (int64_t)key; \ - } \ - } - void KEYSYM(_stp_map_key) (MAP map, ALLKEYSD(key)) { unsigned int hv; @@ -369,15 +361,15 @@ void KEYSYM(_stp_map_key) (MAP map, ALLKEYSD(key)) } dbug ("key not found\n"); - SETKEYS2 (key1, 0); + map->c_key[0] = (key_data)key1; #if KEY_ARITY > 1 - SETKEYS2 (key2, 1); + map->c_key[1] = (key_data)key2; #if KEY_ARITY > 2 - SETKEYS2 (key3, 2); + map->c_key[2] = (key_data)key3; #if KEY_ARITY > 3 - SETKEYS2 (key4, 3); + map->c_key[3] = (key_data)key4; #if KEY_ARITY > 4 - SETKEYS2 (key5, 4); + map->c_key[4] = (key_data)key5; #endif #endif #endif -- cgit