projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Treewide: use bool instead of _Bool
[collectd.git]
/
src
/
write_mongodb.c
diff --git
a/src/write_mongodb.c
b/src/write_mongodb.c
index
46b6d86
..
f9bd1a0
100644
(file)
--- a/
src/write_mongodb.c
+++ b/
src/write_mongodb.c
@@
-50,8
+50,8
@@
struct wm_node_s {
char *user;
char *passwd;
char *user;
char *passwd;
-
_B
ool store_rates;
-
_B
ool connected;
+
b
ool store_rates;
+
b
ool connected;
mongoc_client_t *client;
mongoc_database_t *database;
mongoc_client_t *client;
mongoc_database_t *database;
@@
-63,7
+63,7
@@
typedef struct wm_node_s wm_node_t;
* Functions
*/
static bson_t *wm_create_bson(const data_set_t *ds, /* {{{ */
* Functions
*/
static bson_t *wm_create_bson(const data_set_t *ds, /* {{{ */
- const value_list_t *vl,
_B
ool store_rates) {
+ const value_list_t *vl,
b
ool store_rates) {
bson_t *ret;
bson_t subarray;
gauge_t *rates;
bson_t *ret;
bson_t subarray;
gauge_t *rates;
@@
-96,7
+96,7
@@
static bson_t *wm_create_bson(const data_set_t *ds, /* {{{ */
for (size_t i = 0; i < ds->ds_num; i++) {
char key[16];
for (size_t i = 0; i < ds->ds_num; i++) {
char key[16];
- snprintf(key, sizeof(key), "%
zu"
, i);
+ snprintf(key, sizeof(key), "%
" PRIsz
, i);
if (ds->ds[i].type == DS_TYPE_GAUGE)
BSON_APPEND_DOUBLE(&subarray, key, vl->values[i].gauge);
if (ds->ds[i].type == DS_TYPE_GAUGE)
BSON_APPEND_DOUBLE(&subarray, key, vl->values[i].gauge);
@@
-109,7
+109,7
@@
static bson_t *wm_create_bson(const data_set_t *ds, /* {{{ */
else if (ds->ds[i].type == DS_TYPE_ABSOLUTE)
BSON_APPEND_INT64(&subarray, key, vl->values[i].absolute);
else {
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 %
zu"
,
+ ERROR("write_mongodb plugin: Unknown ds_type %d for index %
" PRIsz
,
ds->ds[i].type, i);
bson_destroy(ret);
return NULL;
ds->ds[i].type, i);
bson_destroy(ret);
return NULL;
@@
-121,7
+121,7
@@
static bson_t *wm_create_bson(const data_set_t *ds, /* {{{ */
for (size_t i = 0; i < ds->ds_num; i++) {
char key[16];
for (size_t i = 0; i < ds->ds_num; i++) {
char key[16];
- snprintf(key, sizeof(key), "%
zu"
, i);
+ snprintf(key, sizeof(key), "%
" PRIsz
, i);
if (store_rates)
BSON_APPEND_UTF8(&subarray, key, "gauge");
if (store_rates)
BSON_APPEND_UTF8(&subarray, key, "gauge");
@@
-134,7
+134,7
@@
static bson_t *wm_create_bson(const data_set_t *ds, /* {{{ */
for (size_t i = 0; i < ds->ds_num; i++) {
char key[16];
for (size_t i = 0; i < ds->ds_num; i++) {
char key[16];
- snprintf(key, sizeof(key), "%
zu"
, i);
+ snprintf(key, sizeof(key), "%
" PRIsz
, i);
BSON_APPEND_UTF8(&subarray, key, ds->ds[i].name);
}
bson_append_array_end(ret, &subarray); /* }}} dsnames */
BSON_APPEND_UTF8(&subarray, key, ds->ds[i].name);
}
bson_append_array_end(ret, &subarray); /* }}} dsnames */
@@
-144,7
+144,7
@@
static bson_t *wm_create_bson(const data_set_t *ds, /* {{{ */
size_t error_location;
if (!bson_validate(ret, BSON_VALIDATE_UTF8, &error_location)) {
ERROR("write_mongodb plugin: Error in generated BSON document "
size_t error_location;
if (!bson_validate(ret, BSON_VALIDATE_UTF8, &error_location)) {
ERROR("write_mongodb plugin: Error in generated BSON document "
- "at byte %
zu"
,
+ "at byte %
" PRIsz
,
error_location);
bson_destroy(ret);
return NULL;
error_location);
bson_destroy(ret);
return NULL;