X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fdaemon%2Futils_cache.c;h=b756d3b6b73a1be0cc5981cd743a927b188deffb;hp=ea7c3e33b4ab9e064b26e26ae6657d983dc605ea;hb=a9e50e9e30ecde17e167e271060c8183bfcbf407;hpb=4380983e0a45e2d1c1207dbea95863d1dcc844c6 diff --git a/src/daemon/utils_cache.c b/src/daemon/utils_cache.c index ea7c3e33..b756d3b6 100644 --- a/src/daemon/utils_cache.c +++ b/src/daemon/utils_cache.c @@ -154,7 +154,7 @@ static int uc_insert(const data_set_t *ds, const value_list_t *vl, ce = cache_alloc(ds->ds_num); if (ce == NULL) { sfree(key_copy); - ERROR("uc_insert: cache_alloc (%zu) failed.", ds->ds_num); + ERROR("uc_insert: cache_alloc (%" PRIsz ") failed.", ds->ds_num); return -1; } @@ -381,7 +381,7 @@ int uc_update(const data_set_t *ds, const value_list_t *vl) { return -1; } /* switch (ds->ds[i].type) */ - DEBUG("uc_update: %s: ds[%zu] = %lf", name, i, ce->values_gauge[i]); + DEBUG("uc_update: %s: ds[%" PRIsz "] = %lf", name, i, ce->values_gauge[i]); } /* for (i) */ /* Update the history if it exists. */ @@ -469,8 +469,8 @@ gauge_t *uc_get_rate(const data_set_t *ds, const value_list_t *vl) { /* This is important - the caller has no other way of knowing how many * values are returned. */ if (ret_num != ds->ds_num) { - ERROR("utils_cache: uc_get_rate: ds[%s] has %zu values, " - "but uc_get_rate_by_name returned %zu.", + ERROR("utils_cache: uc_get_rate: ds[%s] has %" PRIsz " values, " + "but uc_get_rate_by_name returned %" PRIsz ".", ds->type, ds->ds_num, ret_num); sfree(ret); return NULL; @@ -488,7 +488,7 @@ int uc_get_value_by_name(const char *name, value_t **ret_values, pthread_mutex_lock(&cache_lock); - if (c_avl_get(cache_tree, name, (void *) &ce) == 0) { + if (c_avl_get(cache_tree, name, (void *)&ce) == 0) { assert(ce != NULL); /* remove missing values from getval */ @@ -504,8 +504,7 @@ int uc_get_value_by_name(const char *name, value_t **ret_values, memcpy(ret, ce->values_raw, ret_num * sizeof(value_t)); } } - } - else { + } else { DEBUG("utils_cache: uc_get_value_by_name: No such value: %s", name); status = -1; } @@ -537,10 +536,10 @@ value_t *uc_get_value(const data_set_t *ds, const value_list_t *vl) { /* This is important - the caller has no other way of knowing how many * values are returned. */ - if (ret_num != (size_t) ds->ds_num) { - ERROR("utils_cache: uc_get_value: ds[%s] has %zu values, " - "but uc_get_value_by_name returned %zu.", ds->type, ds->ds_num, - ret_num); + if (ret_num != (size_t)ds->ds_num) { + ERROR("utils_cache: uc_get_value: ds[%s] has %" PRIsz " values, " + "but uc_get_value_by_name returned %" PRIsz ".", + ds->type, ds->ds_num, ret_num); sfree(ret); return (NULL); }