switch back 'http_attrs_num' to type size_t
authorjaroug <jaroug@gmail.com>
Wed, 1 Mar 2017 19:07:23 +0000 (20:07 +0100)
committerjaroug <jaroug@gmail.com>
Wed, 1 Mar 2017 19:07:23 +0000 (20:07 +0100)
src/utils_format_kairosdb.c
src/utils_format_kairosdb.h

index a5d3699..2a14f0e 100644 (file)
@@ -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);
index bfe505c..b6aa39d 100644 (file)
@@ -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);