summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 619755e)
raw | patch | inline | side by side (parent: 619755e)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 8 Jul 2017 10:12:33 +0000 (12:12 +0200) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Sat, 8 Jul 2017 10:12:33 +0000 (12:12 +0200) |
CC src/write_mongodb_la-write_mongodb.lo
src/write_mongodb.c:96:21: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') [-Wsign-compare]
for (int i = 0; i < ds->ds_num; i++) {
~ ^ ~~~~~~~~~~
src/write_mongodb.c:121:21: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') [-Wsign-compare]
for (int i = 0; i < ds->ds_num; i++) {
~ ^ ~~~~~~~~~~
src/write_mongodb.c:134:21: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') [-Wsign-compare]
for (int i = 0; i < ds->ds_num; i++) {
~ ^ ~~~~~~~~~~
3 warnings generated.
src/write_mongodb.c:96:21: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') [-Wsign-compare]
for (int i = 0; i < ds->ds_num; i++) {
~ ^ ~~~~~~~~~~
src/write_mongodb.c:121:21: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') [-Wsign-compare]
for (int i = 0; i < ds->ds_num; i++) {
~ ^ ~~~~~~~~~~
src/write_mongodb.c:134:21: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') [-Wsign-compare]
for (int i = 0; i < ds->ds_num; i++) {
~ ^ ~~~~~~~~~~
3 warnings generated.
src/write_mongodb.c | patch | blob | history |
diff --git a/src/write_mongodb.c b/src/write_mongodb.c
index e90900ec12f8cf2c3f53fbed2830ea97d191ab42..e1fb41fd9a500ee210bc3f91c630c05d0c8d79a3 100644 (file)
--- a/src/write_mongodb.c
+++ b/src/write_mongodb.c
BSON_APPEND_UTF8(ret, "type_instance", vl->type_instance);
BSON_APPEND_ARRAY_BEGIN(ret, "values", &subarray); /* {{{ */
- for (int i = 0; i < ds->ds_num; i++) {
+ for (size_t i = 0; i < ds->ds_num; i++) {
char key[16];
- ssnprintf(key, sizeof(key), "%i", i);
+ ssnprintf(key, sizeof(key), "%zu", i);
if (ds->ds[i].type == DS_TYPE_GAUGE)
BSON_APPEND_DOUBLE(&subarray, key, vl->values[i].gauge);
else if (ds->ds[i].type == DS_TYPE_ABSOLUTE)
BSON_APPEND_INT64(&subarray, key, vl->values[i].absolute);
else {
- ERROR("write_mongodb plugin: Unknown ds_type %d for index %d",
+ ERROR("write_mongodb plugin: Unknown ds_type %d for index %zu",
ds->ds[i].type, i);
bson_destroy(ret);
return NULL;
bson_append_array_end(ret, &subarray); /* }}} values */
BSON_APPEND_ARRAY_BEGIN(ret, "dstypes", &subarray); /* {{{ */
- for (int i = 0; i < ds->ds_num; i++) {
+ for (size_t i = 0; i < ds->ds_num; i++) {
char key[16];
- ssnprintf(key, sizeof(key), "%i", i);
+ ssnprintf(key, sizeof(key), "%zu", i);
if (store_rates)
BSON_APPEND_UTF8(&subarray, key, "gauge");
bson_append_array_end(ret, &subarray); /* }}} dstypes */
BSON_APPEND_ARRAY_BEGIN(ret, "dsnames", &subarray); /* {{{ */
- for (int i = 0; i < ds->ds_num; i++) {
+ for (size_t i = 0; i < ds->ds_num; i++) {
char key[16];
- ssnprintf(key, sizeof(key), "%i", i);
+ ssnprintf(key, sizeof(key), "%zu", i);
BSON_APPEND_UTF8(&subarray, key, ds->ds[i].name);
}
bson_append_array_end(ret, &subarray); /* }}} dsnames */