projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't initialize static pointers to NULL
[collectd.git]
/
src
/
gmond.c
diff --git
a/src/gmond.c
b/src/gmond.c
index
09f94ae
..
6ed4115
100644
(file)
--- a/
src/gmond.c
+++ b/
src/gmond.c
@@
-84,14
+84,14
@@
struct metric_map_s {
typedef struct metric_map_s metric_map_t;
#define MC_RECEIVE_GROUP_DEFAULT "239.2.11.71"
typedef struct metric_map_s metric_map_t;
#define MC_RECEIVE_GROUP_DEFAULT "239.2.11.71"
-static char *mc_receive_group
= NULL
;
+static char *mc_receive_group;
#define MC_RECEIVE_PORT_DEFAULT "8649"
#define MC_RECEIVE_PORT_DEFAULT "8649"
-static char *mc_receive_port
= NULL
;
+static char *mc_receive_port;
-static struct pollfd *mc_receive_sockets
= NULL
;
+static struct pollfd *mc_receive_sockets;
static size_t mc_receive_sockets_num = 0;
static size_t mc_receive_sockets_num = 0;
-static socket_entry_t *mc_send_sockets
= NULL
;
+static socket_entry_t *mc_send_sockets;
static size_t mc_send_sockets_num = 0;
static pthread_mutex_t mc_send_sockets_lock = PTHREAD_MUTEX_INITIALIZER;
static size_t mc_send_sockets_num = 0;
static pthread_mutex_t mc_send_sockets_lock = PTHREAD_MUTEX_INITIALIZER;
@@
-122,7
+122,7
@@
static metric_map_t metric_map_default[] =
{"pkts_out", "if_packets", "", "tx", -1, -1}};
static size_t metric_map_len_default = STATIC_ARRAY_SIZE(metric_map_default);
{"pkts_out", "if_packets", "", "tx", -1, -1}};
static size_t metric_map_len_default = STATIC_ARRAY_SIZE(metric_map_default);
-static metric_map_t *metric_map
= NULL
;
+static metric_map_t *metric_map;
static size_t metric_map_len = 0;
static c_avl_tree_t *staging_tree;
static size_t metric_map_len = 0;
static c_avl_tree_t *staging_tree;
@@
-454,7
+454,8
@@
static int staging_entry_update(const char *host, const char *name, /* {{{ */
}
if (ds->ds_num <= ds_index) {
}
if (ds->ds_num <= ds_index) {
- ERROR("gmond plugin: Invalid index %zu: %s has only %zu data source(s).",
+ ERROR("gmond plugin: Invalid index %" PRIsz ": %s has only %" PRIsz
+ " data source(s).",
ds_index, ds->type, ds->ds_num);
return -1;
}
ds_index, ds->type, ds->ds_num);
return -1;
}