From: jaroug Date: Wed, 1 Mar 2017 19:07:23 +0000 (+0100) Subject: switch back 'http_attrs_num' to type size_t X-Git-Tag: collectd-5.8.0~202^2~2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=415d49a7a131ff72093967d499281585548cfa81;p=collectd.git switch back 'http_attrs_num' to type size_t --- diff --git a/src/utils_format_kairosdb.c b/src/utils_format_kairosdb.c index a5d36990..2a14f0ed 100644 --- a/src/utils_format_kairosdb.c +++ b/src/utils_format_kairosdb.c @@ -183,7 +183,7 @@ static int value_list_to_kairosdb(char *buffer, size_t buffer_size, /* {{{ */ const data_set_t *ds, const value_list_t *vl, int store_rates, char const *const *http_attrs, - const int http_attrs_num) { + size_t http_attrs_num) { char temp[512]; size_t offset = 0; int status; @@ -233,7 +233,7 @@ static int value_list_to_kairosdb(char *buffer, size_t buffer_size, /* {{{ */ BUFFER_ADD(", \"tags\":\{"); BUFFER_ADD("\"host\": \"%s\"", vl->host); - for (int j = 0; j < http_attrs_num; j += 2) { + for (size_t j = 0; j < http_attrs_num; j += 2) { BUFFER_ADD(", \"%s\":", http_attrs[j]); BUFFER_ADD(" \"%s\"", http_attrs[j + 1]); } @@ -260,7 +260,7 @@ static int format_kairosdb_value_list_nocheck( char *buffer, /* {{{ */ size_t *ret_buffer_fill, size_t *ret_buffer_free, const data_set_t *ds, const value_list_t *vl, int store_rates, size_t temp_size, - char const *const *http_attrs, const int http_attrs_num) { + char const *const *http_attrs, size_t http_attrs_num) { char temp[temp_size]; int status; @@ -334,7 +334,7 @@ int format_kairosdb_value_list(char *buffer, /* {{{ */ size_t *ret_buffer_fill, size_t *ret_buffer_free, const data_set_t *ds, const value_list_t *vl, int store_rates, char const *const *http_attrs, - const int http_attrs_num) { + size_t http_attrs_num) { if ((buffer == NULL) || (ret_buffer_fill == NULL) || (ret_buffer_free == NULL) || (ds == NULL) || (vl == NULL)) return (-EINVAL); diff --git a/src/utils_format_kairosdb.h b/src/utils_format_kairosdb.h index bfe505c9..b6aa39d4 100644 --- a/src/utils_format_kairosdb.h +++ b/src/utils_format_kairosdb.h @@ -41,7 +41,7 @@ int format_kairosdb_value_list(char *buffer, size_t *ret_buffer_fill, size_t *ret_buffer_free, const data_set_t *ds, const value_list_t *vl, int store_rates, char const *const *http_attrs, - const int http_attrs_num); + size_t http_attrs_num); int format_kairosdb_finalize(char *buffer, size_t *ret_buffer_fill, size_t *ret_buffer_free);