projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #2618 from ajssmith/amqp1_dev1_branch
[collectd.git]
/
src
/
ceph.c
diff --git
a/src/ceph.c
b/src/ceph.c
index
73140a5
..
2622dc7
100644
(file)
--- a/
src/ceph.c
+++ b/
src/ceph.c
@@
-148,7
+148,7
@@
enum perfcounter_type_d {
};
/** Give user option to use default (long run = since daemon started) avg */
};
/** Give user option to use default (long run = since daemon started) avg */
-static int long_run_latency_avg
= 0
;
+static int long_run_latency_avg;
/**
* Give user option to use default type for special cases -
/**
* Give user option to use default type for special cases -
@@
-161,10
+161,10
@@
static int long_run_latency_avg = 0;
static int convert_special_metrics = 1;
/** Array of daemons to monitor */
static int convert_special_metrics = 1;
/** Array of daemons to monitor */
-static struct ceph_daemon **g_daemons
= NULL
;
+static struct ceph_daemon **g_daemons;
/** Number of elements in g_daemons */
/** Number of elements in g_daemons */
-static size_t g_num_daemons
= 0
;
+static size_t g_num_daemons;
/**
* A set of data that we build up in memory while parsing the JSON.
/**
* A set of data that we build up in memory while parsing the JSON.
@@
-404,8
+404,8
@@
static int compact_ds_name(char *buffer, size_t buffer_size, char const *src) {
size_t src_len;
char *ptr = buffer;
size_t ptr_size = buffer_size;
size_t src_len;
char *ptr = buffer;
size_t ptr_size = buffer_size;
-
_Bool append_plus = 0
;
-
_Bool append_minus = 0
;
+
bool append_plus = false
;
+
bool append_minus = false
;
if ((buffer == NULL) || (buffer_size <= strlen("Minus")) || (src == NULL))
return EINVAL;
if ((buffer == NULL) || (buffer_size <= strlen("Minus")) || (src == NULL))
return EINVAL;
@@
-415,11
+415,11
@@
static int compact_ds_name(char *buffer, size_t buffer_size, char const *src) {
/* Remove trailing "+" and "-". */
if (src_copy[src_len - 1] == '+') {
/* Remove trailing "+" and "-". */
if (src_copy[src_len - 1] == '+') {
- append_plus =
1
;
+ append_plus =
true
;
src_len--;
src_copy[src_len] = 0;
} else if (src_copy[src_len - 1] == '-') {
src_len--;
src_copy[src_len] = 0;
} else if (src_copy[src_len - 1] == '-') {
- append_minus =
1
;
+ append_minus =
true
;
src_len--;
src_copy[src_len] = 0;
}
src_len--;
src_copy[src_len] = 0;
}
@@
-470,19
+470,19
@@
static int compact_ds_name(char *buffer, size_t buffer_size, char const *src) {
return 0;
}
return 0;
}
-static
_B
ool has_suffix(char const *str, char const *suffix) {
+static
b
ool has_suffix(char const *str, char const *suffix) {
size_t str_len = strlen(str);
size_t suffix_len = strlen(suffix);
size_t offset;
if (suffix_len > str_len)
size_t str_len = strlen(str);
size_t suffix_len = strlen(suffix);
size_t offset;
if (suffix_len > str_len)
- return
0
;
+ return
false
;
offset = str_len - suffix_len;
if (strcmp(str + offset, suffix) == 0)
offset = str_len - suffix_len;
if (strcmp(str + offset, suffix) == 0)
- return
1
;
+ return
true
;
- return
0
;
+ return
false
;
}
static void cut_suffix(char *buffer, size_t buffer_size, char const *str,
}
static void cut_suffix(char *buffer, size_t buffer_size, char const *str,
@@
-1341,7
+1341,7
@@
static int cconn_main_loop(uint32_t request_type) {
struct cconn *io = io_array + i;
ret = cconn_prepare(io, fds + nfds);
if (ret < 0) {
struct cconn *io = io_array + i;
ret = cconn_prepare(io, fds + nfds);
if (ret < 0) {
- WARNING("ceph plugin: cconn_prepare(name=%s,i=%
zu
,st=%d)=%d",
+ WARNING("ceph plugin: cconn_prepare(name=%s,i=%
" PRIsz "
,st=%d)=%d",
io->d->name, i, io->state, ret);
cconn_close(io);
io->request_type = ASOK_REQ_NONE;
io->d->name, i, io->state, ret);
cconn_close(io);
io->request_type = ASOK_REQ_NONE;