summaryrefslogtreecommitdiffstats
path: root/runtime/map-keys.c
diff options
context:
space:
mode:
authorhunt <hunt>2005-05-18 00:25:31 +0000
committerhunt <hunt>2005-05-18 00:25:31 +0000
commitf1a8ce9fda66ec5a3295a4b79ff3f3ec0195d994 (patch)
tree3218fc90339d9f3ba7cb543d4992a6b27f5bd206 /runtime/map-keys.c
parent042803219fdd22aed9a134d46788ed01d29e1d7c (diff)
downloadsystemtap-steved-f1a8ce9fda66ec5a3295a4b79ff3f3ec0195d994.tar.gz
systemtap-steved-f1a8ce9fda66ec5a3295a4b79ff3f3ec0195d994.tar.xz
systemtap-steved-f1a8ce9fda66ec5a3295a4b79ff3f3ec0195d994.zip
2005-05-17 Martin Hunt <hunt@redhat.com>
* 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.
Diffstat (limited to 'runtime/map-keys.c')
-rw-r--r--runtime/map-keys.c18
1 files changed, 5 insertions, 13 deletions
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