From af5dd76bca996577262e447fd8bff1bd0df30db7 Mon Sep 17 00:00:00 2001 From: hunt Date: Wed, 26 Oct 2005 08:29:38 +0000 Subject: 2005-10-26 Martin Hunt * map.c (_new_map_create, _new_map_del_node, _new_map_del_node, _new_map_set_int64, _new_map_set_str,_new_map_get_int64, _new_map_get_str, _new_map_get_stat, _new_map_set_stat): New internal functions for the new API. * map-int.c (__stp_map_set_int64): Modify to return an error code. * map-stat.c (_stp_map_add_stat): Ditto. * map-str (_stp_map_set_str): Ditto. * Doxyfile: Remove predefines NEED_STRING_VALS, NEED_STATS, NEED_INT64. * map-keys.c: Ditto. * list.c (_stp_list_new): Ditto. Also set map->list. * map-values.c: Ditto. --- runtime/map-stat.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'runtime/map-stat.c') diff --git a/runtime/map-stat.c b/runtime/map-stat.c index ea76d654..85a50ee8 100644 --- a/runtime/map-stat.c +++ b/runtime/map-stat.c @@ -15,29 +15,30 @@ #include "stat-common.c" /* Adds an int64 to a stats map */ -static void _stp_map_add_stat (MAP map, int64_t val) +static int _stp_map_add_stat (MAP map, int64_t val) { stat *d; Stat st; if (map == NULL) - return; + return -2; if (map->create) { struct map_node *m = __stp_map_create (map); if (!m) - return; + return -1; /* set the value */ d = (stat *)((long)m + map->data_offset); d->count = 0; } else { if (map->key == NULL) - return; + return -2; d = (stat *)((long)map->key + map->data_offset); } st = (Stat)((long)map + offsetof(struct map_root, hist_type)); __stp_stat_add (st, d, val); + return 0; } -- cgit