projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6c170c9
)
Don't initialize static pointers to NULL
author
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Mon, 14 May 2018 10:48:25 +0000
(12:48 +0200)
committer
Ruben Kerkhof
<ruben@rubenkerkhof.com>
Mon, 14 May 2018 12:12:50 +0000
(14:12 +0200)
This is the default
83 files changed:
src/aggregation.c
patch
|
blob
|
history
src/amqp.c
patch
|
blob
|
history
src/apcups.c
patch
|
blob
|
history
src/aquaero.c
patch
|
blob
|
history
src/ascent.c
patch
|
blob
|
history
src/barometer.c
patch
|
blob
|
history
src/bind.c
patch
|
blob
|
history
src/ceph.c
patch
|
blob
|
history
src/cgroups.c
patch
|
blob
|
history
src/collectd-nagios.c
patch
|
blob
|
history
src/collectd-tg.c
patch
|
blob
|
history
src/collectdmon.c
patch
|
blob
|
history
src/cpu.c
patch
|
blob
|
history
src/csv.c
patch
|
blob
|
history
src/curl.c
patch
|
blob
|
history
src/daemon/configfile.c
patch
|
blob
|
history
src/daemon/plugin.c
patch
|
blob
|
history
src/daemon/utils_cache.c
patch
|
blob
|
history
src/dbi.c
patch
|
blob
|
history
src/df.c
patch
|
blob
|
history
src/disk.c
patch
|
blob
|
history
src/dns.c
patch
|
blob
|
history
src/email.c
patch
|
blob
|
history
src/ethstat.c
patch
|
blob
|
history
src/exec.c
patch
|
blob
|
history
src/filecount.c
patch
|
blob
|
history
src/gmond.c
patch
|
blob
|
history
src/hddtemp.c
patch
|
blob
|
history
src/intel_rdt.c
patch
|
blob
|
history
src/interface.c
patch
|
blob
|
history
src/ipmi.c
patch
|
blob
|
history
src/iptables.c
patch
|
blob
|
history
src/irq.c
patch
|
blob
|
history
src/java.c
patch
|
blob
|
history
src/log_logstash.c
patch
|
blob
|
history
src/logfile.c
patch
|
blob
|
history
src/madwifi.c
patch
|
blob
|
history
src/mbmon.c
patch
|
blob
|
history
src/md.c
patch
|
blob
|
history
src/memcachec.c
patch
|
blob
|
history
src/mic.c
patch
|
blob
|
history
src/modbus.c
patch
|
blob
|
history
src/mqtt.c
patch
|
blob
|
history
src/netlink.c
patch
|
blob
|
history
src/network.c
patch
|
blob
|
history
src/nginx.c
patch
|
blob
|
history
src/notify_email.c
patch
|
blob
|
history
src/ntpd.c
patch
|
blob
|
history
src/nut.c
patch
|
blob
|
history
src/olsrd.c
patch
|
blob
|
history
src/onewire.c
patch
|
blob
|
history
src/oracle.c
patch
|
blob
|
history
src/perl.c
patch
|
blob
|
history
src/pinba.c
patch
|
blob
|
history
src/ping.c
patch
|
blob
|
history
src/postgresql.c
patch
|
blob
|
history
src/powerdns.c
patch
|
blob
|
history
src/processes.c
patch
|
blob
|
history
src/protocols.c
patch
|
blob
|
history
src/pyconfig.c
patch
|
blob
|
history
src/pyvalues.c
patch
|
blob
|
history
src/redis.c
patch
|
blob
|
history
src/rrdcached.c
patch
|
blob
|
history
src/rrdtool.c
patch
|
blob
|
history
src/sensors.c
patch
|
blob
|
history
src/smart.c
patch
|
blob
|
history
src/snmp.c
patch
|
blob
|
history
src/snmp_agent.c
patch
|
blob
|
history
src/statsd.c
patch
|
blob
|
history
src/swap.c
patch
|
blob
|
history
src/tail.c
patch
|
blob
|
history
src/tail_csv.c
patch
|
blob
|
history
src/tcpconns.c
patch
|
blob
|
history
src/teamspeak2.c
patch
|
blob
|
history
src/ted.c
patch
|
blob
|
history
src/tokyotyrant.c
patch
|
blob
|
history
src/unixsock.c
patch
|
blob
|
history
src/utils_dns.c
patch
|
blob
|
history
src/utils_rrdcreate.c
patch
|
blob
|
history
src/uuid.c
patch
|
blob
|
history
src/virt.c
patch
|
blob
|
history
src/write_sensu.c
patch
|
blob
|
history
src/zookeeper.c
patch
|
blob
|
history
diff --git
a/src/aggregation.c
b/src/aggregation.c
index
7d35d41
..
a802199
100644
(file)
--- a/
src/aggregation.c
+++ b/
src/aggregation.c
@@
-83,10
+83,10
@@
struct agg_instance_s /* {{{ */
agg_instance_t *next;
}; /* }}} */
agg_instance_t *next;
}; /* }}} */
-static lookup_t *lookup
= NULL
;
+static lookup_t *lookup;
static pthread_mutex_t agg_instance_list_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t agg_instance_list_lock = PTHREAD_MUTEX_INITIALIZER;
-static agg_instance_t *agg_instance_list_head
= NULL
;
+static agg_instance_t *agg_instance_list_head;
static bool agg_is_regex(char const *str) /* {{{ */
{
static bool agg_is_regex(char const *str) /* {{{ */
{
diff --git
a/src/amqp.c
b/src/amqp.c
index
1557923
..
7a91ba1
100644
(file)
--- a/
src/amqp.c
+++ b/
src/amqp.c
@@
-111,7
+111,7
@@
static const char *def_user = "guest";
static const char *def_password = "guest";
static const char *def_exchange = "amq.fanout";
static const char *def_password = "guest";
static const char *def_exchange = "amq.fanout";
-static pthread_t *subscriber_threads
= NULL
;
+static pthread_t *subscriber_threads;
static size_t subscriber_threads_num = 0;
static bool subscriber_threads_running = true;
static size_t subscriber_threads_num = 0;
static bool subscriber_threads_running = true;
diff --git
a/src/apcups.c
b/src/apcups.c
index
4b3f7b5
..
4e84ebd
100644
(file)
--- a/
src/apcups.c
+++ b/
src/apcups.c
@@
-70,8
+70,8
@@
typedef struct {
* Private variables
*/
/* Default values for contacting daemon */
* Private variables
*/
/* Default values for contacting daemon */
-static char *conf_node
= NULL
;
-static char *conf_service
= NULL
;
+static char *conf_node;
+static char *conf_service;
/* Defaults to false for backwards compatibility. */
static bool conf_report_seconds;
static bool conf_persistent_conn = true;
/* Defaults to false for backwards compatibility. */
static bool conf_report_seconds;
static bool conf_persistent_conn = true;
diff --git
a/src/aquaero.c
b/src/aquaero.c
index
beffc1a
..
937742b
100644
(file)
--- a/
src/aquaero.c
+++ b/
src/aquaero.c
@@
-30,7
+30,7
@@
* Private variables
*/
/* Default values for contacting daemon */
* Private variables
*/
/* Default values for contacting daemon */
-static char *conf_device
= NULL
;
+static char *conf_device;
static int aquaero_config(oconfig_item_t *ci) {
for (int i = 0; i < ci->children_num; i++) {
static int aquaero_config(oconfig_item_t *ci) {
for (int i = 0; i < ci->children_num; i++) {
diff --git
a/src/ascent.c
b/src/ascent.c
index
36694f6
..
09dd5de
100644
(file)
--- a/
src/ascent.c
+++ b/
src/ascent.c
@@
-87,17
+87,17
@@
typedef struct player_info_s player_info_t;
#define PLAYER_INFO_STATIC_INIT \
{ -1, -1, -1, -1, -1 }
#define PLAYER_INFO_STATIC_INIT \
{ -1, -1, -1, -1, -1 }
-static char *url
= NULL
;
-static char *user
= NULL
;
-static char *pass
= NULL
;
-static char *verify_peer
= NULL
;
-static char *verify_host
= NULL
;
-static char *cacert
= NULL
;
-static char *timeout
= NULL
;
+static char *url;
+static char *user;
+static char *pass;
+static char *verify_peer;
+static char *verify_host;
+static char *cacert;
+static char *timeout;
-static CURL *curl
= NULL
;
+static CURL *curl;
-static char *ascent_buffer
= NULL
;
+static char *ascent_buffer;
static size_t ascent_buffer_size = 0;
static size_t ascent_buffer_fill = 0;
static char ascent_curl_error[CURL_ERROR_SIZE];
static size_t ascent_buffer_size = 0;
static size_t ascent_buffer_fill = 0;
static char ascent_curl_error[CURL_ERROR_SIZE];
diff --git
a/src/barometer.c
b/src/barometer.c
index
e55e3b8
..
17c2a1a
100644
(file)
--- a/
src/barometer.c
+++ b/
src/barometer.c
@@
-177,8
+177,8
@@
static const char *config_keys[] = {
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static char *config_device
= NULL;
/**< I2C bus device */
-static int config_oversample = 1;
/**< averaging window */
+static char *config_device
;
/**< I2C bus device */
+static int config_oversample = 1; /**< averaging window */
static double config_press_offset = 0.0; /**< pressure offset */
static double config_temp_offset = 0.0; /**< temperature offset */
static double config_press_offset = 0.0; /**< pressure offset */
static double config_temp_offset = 0.0; /**< temperature offset */
@@
-235,8
+235,8
@@
typedef struct averaging_s {
int ring_buffer_head;
} averaging_t;
int ring_buffer_head;
} averaging_t;
-static averaging_t pressure_averaging
= {NULL, 0, 0L, 0}
;
-static averaging_t temperature_averaging
= {NULL, 0, 0L, 0}
;
+static averaging_t pressure_averaging;
+static averaging_t temperature_averaging;
/**
* Create / allocate averaging buffer
/**
* Create / allocate averaging buffer
@@
-317,7
+317,7
@@
typedef struct temperature_list_s {
struct temperature_list_s *next; /**< next in the list */
} temperature_list_t;
struct temperature_list_s *next; /**< next in the list */
} temperature_list_t;
-static temperature_list_t *temp_list
= NULL
;
+static temperature_list_t *temp_list;
/*
* Add new sensor to the temperature reference list
/*
* Add new sensor to the temperature reference list
diff --git
a/src/bind.c
b/src/bind.c
index
cc5aa59
..
2d10aba
100644
(file)
--- a/
src/bind.c
+++ b/
src/bind.c
@@
-106,7
+106,7
@@
typedef struct list_info_ptr_s list_info_ptr_t;
/* TODO: Remove time parsing code. */
static bool config_parse_time = true;
/* TODO: Remove time parsing code. */
static bool config_parse_time = true;
-static char *url
= NULL
;
+static char *url;
static int global_opcodes = 1;
static int global_qtypes = 1;
static int global_server_stats = 1;
static int global_opcodes = 1;
static int global_qtypes = 1;
static int global_server_stats = 1;
@@
-115,12
+115,12
@@
static int global_resolver_stats = 0;
static int global_memory_stats = 1;
static int timeout = -1;
static int global_memory_stats = 1;
static int timeout = -1;
-static cb_view_t *views
= NULL
;
+static cb_view_t *views;
static size_t views_num = 0;
static size_t views_num = 0;
-static CURL *curl
= NULL
;
+static CURL *curl;
-static char *bind_buffer
= NULL
;
+static char *bind_buffer;
static size_t bind_buffer_size = 0;
static size_t bind_buffer_fill = 0;
static char bind_curl_error[CURL_ERROR_SIZE];
static size_t bind_buffer_size = 0;
static size_t bind_buffer_fill = 0;
static char bind_curl_error[CURL_ERROR_SIZE];
diff --git
a/src/ceph.c
b/src/ceph.c
index
804514c
..
e2c98ed
100644
(file)
--- a/
src/ceph.c
+++ b/
src/ceph.c
@@
-161,7
+161,7
@@
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 */
static size_t g_num_daemons = 0;
/** Number of elements in g_daemons */
static size_t g_num_daemons = 0;
diff --git
a/src/cgroups.c
b/src/cgroups.c
index
5830c7b
..
7f24d12
100644
(file)
--- a/
src/cgroups.c
+++ b/
src/cgroups.c
@@
-31,7
+31,7
@@
static char const *config_keys[] = {"CGroup", "IgnoreSelected"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
static char const *config_keys[] = {"CGroup", "IgnoreSelected"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static ignorelist_t *il_cgroup
= NULL
;
+static ignorelist_t *il_cgroup;
__attribute__((nonnull(1))) __attribute__((nonnull(2))) static void
cgroups_submit_one(char const *plugin_instance, char const *type_instance,
__attribute__((nonnull(1))) __attribute__((nonnull(2))) static void
cgroups_submit_one(char const *plugin_instance, char const *type_instance,
diff --git
a/src/collectd-nagios.c
b/src/collectd-nagios.c
index
2c9bf4a
..
68ed437
100644
(file)
--- a/
src/collectd-nagios.c
+++ b/
src/collectd-nagios.c
@@
-94,16
+94,16
@@
typedef struct range_s range_t;
extern char *optarg;
extern int optind, opterr, optopt;
extern char *optarg;
extern int optind, opterr, optopt;
-static char *socket_file_g
= NULL
;
-static char *value_string_g
= NULL
;
-static char *hostname_g
= NULL
;
+static char *socket_file_g;
+static char *value_string_g;
+static char *hostname_g;
static range_t range_critical_g;
static range_t range_warning_g;
static int consolitation_g = CON_NONE;
static bool nan_is_error_g;
static range_t range_critical_g;
static range_t range_warning_g;
static int consolitation_g = CON_NONE;
static bool nan_is_error_g;
-static char **match_ds_g
= NULL
;
+static char **match_ds_g;
static size_t match_ds_num_g = 0;
/* `strdup' is an XSI extension. I don't want to pull in all of XSI just for
static size_t match_ds_num_g = 0;
/* `strdup' is an XSI extension. I don't want to pull in all of XSI just for
diff --git
a/src/collectd-tg.c
b/src/collectd-tg.c
index
64547b8
..
9357ce3
100644
(file)
--- a/
src/collectd-tg.c
+++ b/
src/collectd-tg.c
@@
-62,7
+62,7
@@
static const char *conf_service = NET_DEFAULT_PORT;
static lcc_network_t *net;
static lcc_network_t *net;
-static c_heap_t *values_heap
= NULL
;
+static c_heap_t *values_heap;
static struct sigaction sigint_action;
static struct sigaction sigterm_action;
static struct sigaction sigint_action;
static struct sigaction sigterm_action;
diff --git
a/src/collectdmon.c
b/src/collectdmon.c
index
4a7d1a6
..
6c19889
100644
(file)
--- a/
src/collectdmon.c
+++ b/
src/collectdmon.c
@@
-74,7
+74,7
@@
static int loop = 0;
static int restart = 0;
static int loop = 0;
static int restart = 0;
-static const char *pidfile
= NULL
;
+static const char *pidfile;
static pid_t collectd_pid = 0;
__attribute__((noreturn)) static void exit_usage(const char *name) {
static pid_t collectd_pid = 0;
__attribute__((noreturn)) static void exit_usage(const char *name) {
diff --git
a/src/cpu.c
b/src/cpu.c
index
5a32b6b
..
7478a4a
100644
(file)
--- a/
src/cpu.c
+++ b/
src/cpu.c
@@
-187,7
+187,7
@@
struct cpu_state_s {
};
typedef struct cpu_state_s cpu_state_t;
};
typedef struct cpu_state_s cpu_state_t;
-static cpu_state_t *cpu_states
= NULL
;
+static cpu_state_t *cpu_states;
static size_t cpu_states_num = 0; /* #cpu_states allocated */
/* Highest CPU number in the current iteration. Used by the dispatch logic to
static size_t cpu_states_num = 0; /* #cpu_states allocated */
/* Highest CPU number in the current iteration. Used by the dispatch logic to
diff --git
a/src/csv.c
b/src/csv.c
index
f5126d2
..
34fc223
100644
(file)
--- a/
src/csv.c
+++ b/
src/csv.c
@@
-33,7
+33,7
@@
static const char *config_keys[] = {"DataDir", "StoreRates"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
static const char *config_keys[] = {"DataDir", "StoreRates"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static char *datadir
= NULL
;
+static char *datadir;
static int store_rates = 0;
static int use_stdio = 0;
static int store_rates = 0;
static int use_stdio = 0;
diff --git
a/src/curl.c
b/src/curl.c
index
769ba23
..
4bfd1e4
100644
(file)
--- a/
src/curl.c
+++ b/
src/curl.c
@@
-85,8
+85,7
@@
struct web_page_s /* {{{ */
/*
* Global variables;
*/
/*
* Global variables;
*/
-/* static CURLM *curl = NULL; */
-static web_page_t *pages_g = NULL;
+static web_page_t *pages_g;
/*
* Private functions
/*
* Private functions
diff --git
a/src/daemon/configfile.c
b/src/daemon/configfile.c
index
e8d1092
..
2830a86
100644
(file)
--- a/
src/daemon/configfile.c
+++ b/
src/daemon/configfile.c
@@
-91,8
+91,8
@@
static int dispatch_block_plugin(oconfig_item_t *ci);
/*
* Private variables
*/
/*
* Private variables
*/
-static cf_callback_t *first_callback
= NULL
;
-static cf_complex_callback_t *complex_callback_head
= NULL
;
+static cf_callback_t *first_callback;
+static cf_complex_callback_t *complex_callback_head;
static cf_value_map_t cf_value_map[] = {{"TypesDB", dispatch_value_typesdb},
{"PluginDir", dispatch_value_plugindir},
static cf_value_map_t cf_value_map[] = {{"TypesDB", dispatch_value_typesdb},
{"PluginDir", dispatch_value_plugindir},
diff --git
a/src/daemon/plugin.c
b/src/daemon/plugin.c
index
734e8a0
..
5374d8d
100644
(file)
--- a/
src/daemon/plugin.c
+++ b/
src/daemon/plugin.c
@@
-94,7
+94,7
@@
typedef struct flush_callback_s flush_callback_t;
/*
* Private variables
*/
/*
* Private variables
*/
-static c_avl_tree_t *plugins_loaded
= NULL
;
+static c_avl_tree_t *plugins_loaded;
static llist_t *list_init;
static llist_t *list_write;
static llist_t *list_init;
static llist_t *list_write;
@@
-104,22
+104,22
@@
static llist_t *list_shutdown;
static llist_t *list_log;
static llist_t *list_notification;
static llist_t *list_log;
static llist_t *list_notification;
-static fc_chain_t *pre_cache_chain
= NULL
;
-static fc_chain_t *post_cache_chain
= NULL
;
+static fc_chain_t *pre_cache_chain;
+static fc_chain_t *post_cache_chain;
static c_avl_tree_t *data_sets;
static c_avl_tree_t *data_sets;
-static char *plugindir
= NULL
;
+static char *plugindir;
#ifndef DEFAULT_MAX_READ_INTERVAL
#define DEFAULT_MAX_READ_INTERVAL TIME_T_TO_CDTIME_T_STATIC(86400)
#endif
#ifndef DEFAULT_MAX_READ_INTERVAL
#define DEFAULT_MAX_READ_INTERVAL TIME_T_TO_CDTIME_T_STATIC(86400)
#endif
-static c_heap_t *read_heap
= NULL
;
+static c_heap_t *read_heap;
static llist_t *read_list;
static int read_loop = 1;
static pthread_mutex_t read_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t read_cond = PTHREAD_COND_INITIALIZER;
static llist_t *read_list;
static int read_loop = 1;
static pthread_mutex_t read_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t read_cond = PTHREAD_COND_INITIALIZER;
-static pthread_t *read_threads
= NULL
;
+static pthread_t *read_threads;
static size_t read_threads_num = 0;
static cdtime_t max_read_interval = DEFAULT_MAX_READ_INTERVAL;
static size_t read_threads_num = 0;
static cdtime_t max_read_interval = DEFAULT_MAX_READ_INTERVAL;
@@
-129,7
+129,7
@@
static long write_queue_length = 0;
static bool write_loop = true;
static pthread_mutex_t write_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t write_cond = PTHREAD_COND_INITIALIZER;
static bool write_loop = true;
static pthread_mutex_t write_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t write_cond = PTHREAD_COND_INITIALIZER;
-static pthread_t *write_threads
= NULL
;
+static pthread_t *write_threads;
static size_t write_threads_num = 0;
static pthread_key_t plugin_ctx_key;
static size_t write_threads_num = 0;
static pthread_key_t plugin_ctx_key;
diff --git
a/src/daemon/utils_cache.c
b/src/daemon/utils_cache.c
index
8e28a5d
..
610c11e
100644
(file)
--- a/
src/daemon/utils_cache.c
+++ b/
src/daemon/utils_cache.c
@@
-76,7
+76,7
@@
struct uc_iter_s {
cache_entry_t *entry;
};
cache_entry_t *entry;
};
-static c_avl_tree_t *cache_tree
= NULL
;
+static c_avl_tree_t *cache_tree;
static pthread_mutex_t cache_lock = PTHREAD_MUTEX_INITIALIZER;
static int cache_compare(const cache_entry_t *a, const cache_entry_t *b) {
static pthread_mutex_t cache_lock = PTHREAD_MUTEX_INITIALIZER;
static int cache_compare(const cache_entry_t *a, const cache_entry_t *b) {
diff --git
a/src/dbi.c
b/src/dbi.c
index
5f8520f
..
dcc32e6
100644
(file)
--- a/
src/dbi.c
+++ b/
src/dbi.c
@@
-85,9
+85,9
@@
typedef struct cdbi_database_s cdbi_database_t; /* }}} */
#if !defined(HAVE_LEGACY_LIBDBI) || !HAVE_LEGACY_LIBDBI
static dbi_inst dbi_instance = 0;
#endif
#if !defined(HAVE_LEGACY_LIBDBI) || !HAVE_LEGACY_LIBDBI
static dbi_inst dbi_instance = 0;
#endif
-static udb_query_t **queries
= NULL
;
+static udb_query_t **queries;
static size_t queries_num = 0;
static size_t queries_num = 0;
-static cdbi_database_t **databases
= NULL
;
+static cdbi_database_t **databases;
static size_t databases_num = 0;
static int cdbi_read_database(user_data_t *ud);
static size_t databases_num = 0;
static int cdbi_read_database(user_data_t *ud);
diff --git
a/src/df.c
b/src/df.c
index
3cade6a
..
e3aa453
100644
(file)
--- a/
src/df.c
+++ b/
src/df.c
@@
-51,9
+51,9
@@
static const char *config_keys[] = {
"ReportByDevice", "ReportInodes", "ValuesAbsolute", "ValuesPercentage"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
"ReportByDevice", "ReportInodes", "ValuesAbsolute", "ValuesPercentage"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static ignorelist_t *il_device
= NULL
;
-static ignorelist_t *il_mountpoint
= NULL
;
-static ignorelist_t *il_fstype
= NULL
;
+static ignorelist_t *il_device;
+static ignorelist_t *il_mountpoint;
+static ignorelist_t *il_fstype;
static bool by_device;
static bool report_inodes;
static bool by_device;
static bool report_inodes;
diff --git
a/src/disk.c
b/src/disk.c
index
962b7c3
..
7b5c024
100644
(file)
--- a/
src/disk.c
+++ b/
src/disk.c
@@
-145,7
+145,7
@@
static int pnumdisk;
#if HAVE_LIBUDEV_H
#include <libudev.h>
#if HAVE_LIBUDEV_H
#include <libudev.h>
-static char *conf_udev_name_attr
= NULL
;
+static char *conf_udev_name_attr;
static struct udev *handle_udev;
#endif
static struct udev *handle_udev;
#endif
@@
-153,7
+153,7
@@
static const char *config_keys[] = {"Disk", "UseBSDName", "IgnoreSelected",
"UdevNameAttr"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
"UdevNameAttr"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static ignorelist_t *ignorelist
= NULL
;
+static ignorelist_t *ignorelist;
static int disk_config(const char *key, const char *value) {
if (ignorelist == NULL)
static int disk_config(const char *key, const char *value) {
if (ignorelist == NULL)
diff --git
a/src/dns.c
b/src/dns.c
index
3ab456b
..
ef627eb
100644
(file)
--- a/
src/dns.c
+++ b/
src/dns.c
@@
-57,7
+57,7
@@
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
static int select_numeric_qtype = 1;
#define PCAP_SNAPLEN 1460
static int select_numeric_qtype = 1;
#define PCAP_SNAPLEN 1460
-static char *pcap_device
= NULL
;
+static char *pcap_device;
static derive_t tr_queries;
static derive_t tr_responses;
static derive_t tr_queries;
static derive_t tr_responses;
diff --git
a/src/email.c
b/src/email.c
index
d94c542
..
4f49cfb
100644
(file)
--- a/
src/email.c
+++ b/
src/email.c
@@
-111,8
+111,8
@@
static const char *config_keys[] = {"SocketFile", "SocketGroup", "SocketPerms",
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
/* socket configuration */
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
/* socket configuration */
-static char *sock_file
= NULL
;
-static char *sock_group
= NULL
;
+static char *sock_file;
+static char *sock_group;
static int sock_perms = S_IRWXU | S_IRWXG;
static int max_conns = MAX_CONNS;
static int sock_perms = S_IRWXU | S_IRWXG;
static int max_conns = MAX_CONNS;
@@
-134,7
+134,7
@@
static conn_list_t conns;
static pthread_cond_t collector_available = PTHREAD_COND_INITIALIZER;
/* collector threads */
static pthread_cond_t collector_available = PTHREAD_COND_INITIALIZER;
/* collector threads */
-static collector_t **collectors
= NULL
;
+static collector_t **collectors;
static pthread_mutex_t available_mutex = PTHREAD_MUTEX_INITIALIZER;
static int available_collectors;
static pthread_mutex_t available_mutex = PTHREAD_MUTEX_INITIALIZER;
static int available_collectors;
diff --git
a/src/ethstat.c
b/src/ethstat.c
index
316c25f
..
371020c
100644
(file)
--- a/
src/ethstat.c
+++ b/
src/ethstat.c
@@
-48,10
+48,10
@@
struct value_map_s {
};
typedef struct value_map_s value_map_t;
};
typedef struct value_map_s value_map_t;
-static char **interfaces
= NULL
;
+static char **interfaces;
static size_t interfaces_num = 0;
static size_t interfaces_num = 0;
-static c_avl_tree_t *value_map
= NULL
;
+static c_avl_tree_t *value_map;
static bool collect_mapped_only;
static bool collect_mapped_only;
diff --git
a/src/exec.c
b/src/exec.c
index
36f2d4d
..
b145e81
100644
(file)
--- a/
src/exec.c
+++ b/
src/exec.c
@@
-80,7
+80,7
@@
typedef struct program_list_and_notification_s {
/*
* Private variables
*/
/*
* Private variables
*/
-static program_list_t *pl_head
= NULL
;
+static program_list_t *pl_head;
static pthread_mutex_t pl_lock = PTHREAD_MUTEX_INITIALIZER;
/*
static pthread_mutex_t pl_lock = PTHREAD_MUTEX_INITIALIZER;
/*
diff --git
a/src/filecount.c
b/src/filecount.c
index
67308f4
..
26c7da3
100644
(file)
--- a/
src/filecount.c
+++ b/
src/filecount.c
@@
-60,7
+60,7
@@
struct fc_directory_conf_s {
};
typedef struct fc_directory_conf_s fc_directory_conf_t;
};
typedef struct fc_directory_conf_s fc_directory_conf_t;
-static fc_directory_conf_t **directories
= NULL
;
+static fc_directory_conf_t **directories;
static size_t directories_num = 0;
static void fc_free_dir(fc_directory_conf_t *dir) {
static size_t directories_num = 0;
static void fc_free_dir(fc_directory_conf_t *dir) {
diff --git
a/src/gmond.c
b/src/gmond.c
index
cb005fd
..
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;
diff --git
a/src/hddtemp.c
b/src/hddtemp.c
index
36c4128
..
80daf15
100644
(file)
--- a/
src/hddtemp.c
+++ b/
src/hddtemp.c
@@
-53,7
+53,7
@@
static const char *config_keys[] = {"Host", "Port"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
static const char *config_keys[] = {"Host", "Port"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static char *hddtemp_host
= NULL
;
+static char *hddtemp_host;
static char hddtemp_port[16];
/*
static char hddtemp_port[16];
/*
diff --git
a/src/intel_rdt.c
b/src/intel_rdt.c
index
29c02fe
..
3d4c988
100644
(file)
--- a/
src/intel_rdt.c
+++ b/
src/intel_rdt.c
@@
-59,7
+59,7
@@
struct rdt_ctx_s {
};
typedef struct rdt_ctx_s rdt_ctx_t;
};
typedef struct rdt_ctx_s rdt_ctx_t;
-static rdt_ctx_t *g_rdt
= NULL
;
+static rdt_ctx_t *g_rdt;
static rdt_config_status g_state = UNKNOWN;
static rdt_config_status g_state = UNKNOWN;
diff --git
a/src/interface.c
b/src/interface.c
index
3e2b2cd
..
4060965
100644
(file)
--- a/
src/interface.c
+++ b/
src/interface.c
@@
-86,7
+86,7
@@
static const char *config_keys[] = {
};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static ignorelist_t *ignorelist
= NULL
;
+static ignorelist_t *ignorelist;
static bool report_inactive = true;
static bool report_inactive = true;
diff --git
a/src/ipmi.c
b/src/ipmi.c
index
2475278
..
7f628bf
100644
(file)
--- a/
src/ipmi.c
+++ b/
src/ipmi.c
@@
-95,8
+95,8
@@
typedef struct c_ipmi_db_type_map_s c_ipmi_db_type_map_t;
/*
* Module global variables
*/
/*
* Module global variables
*/
-static os_handler_t *os_handler
= NULL
;
-static c_ipmi_instance_t *instances
= NULL
;
+static os_handler_t *os_handler;
+static c_ipmi_instance_t *instances;
/*
* Misc private functions
/*
* Misc private functions
diff --git
a/src/iptables.c
b/src/iptables.c
index
bc75d7b
..
c1f42d7
100644
(file)
--- a/
src/iptables.c
+++ b/
src/iptables.c
@@
-86,7
+86,7
@@
typedef struct {
char name[64];
} ip_chain_t;
char name[64];
} ip_chain_t;
-static ip_chain_t **chain_list
= NULL
;
+static ip_chain_t **chain_list;
static int chain_num = 0;
static int iptables_config(const char *key, const char *value) {
static int chain_num = 0;
static int iptables_config(const char *key, const char *value) {
diff --git
a/src/irq.c
b/src/irq.c
index
f8cf37c
..
aa6ac04
100644
(file)
--- a/
src/irq.c
+++ b/
src/irq.c
@@
-37,7
+37,7
@@
static const char *config_keys[] = {"Irq", "IgnoreSelected"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
static const char *config_keys[] = {"Irq", "IgnoreSelected"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static ignorelist_t *ignorelist
= NULL
;
+static ignorelist_t *ignorelist;
/*
* Private functions
/*
* Private functions
diff --git
a/src/java.c
b/src/java.c
index
a35ca46
..
56b48df
100644
(file)
--- a/
src/java.c
+++ b/
src/java.c
@@
-77,23
+77,23
@@
typedef struct cjni_callback_info_s cjni_callback_info_t;
/*
* Global variables
*/
/*
* Global variables
*/
-static JavaVM *jvm
= NULL
;
+static JavaVM *jvm;
static pthread_key_t jvm_env_key;
/* Configuration options for the JVM. */
static pthread_key_t jvm_env_key;
/* Configuration options for the JVM. */
-static char **jvm_argv
= NULL
;
+static char **jvm_argv;
static size_t jvm_argc = 0;
/* List of class names to load */
static size_t jvm_argc = 0;
/* List of class names to load */
-static java_plugin_class_t *java_classes_list
= NULL
;
+static java_plugin_class_t *java_classes_list;
static size_t java_classes_list_len;
/* List of config, init, and shutdown callbacks. */
static size_t java_classes_list_len;
/* List of config, init, and shutdown callbacks. */
-static cjni_callback_info_t *java_callbacks
= NULL
;
+static cjni_callback_info_t *java_callbacks;
static size_t java_callbacks_num = 0;
static pthread_mutex_t java_callbacks_lock = PTHREAD_MUTEX_INITIALIZER;
static size_t java_callbacks_num = 0;
static pthread_mutex_t java_callbacks_lock = PTHREAD_MUTEX_INITIALIZER;
-static oconfig_item_t *config_block
= NULL
;
+static oconfig_item_t *config_block;
/*
* Prototypes
/*
* Prototypes
diff --git
a/src/log_logstash.c
b/src/log_logstash.c
index
2553a28
..
8f3063f
100644
(file)
--- a/
src/log_logstash.c
+++ b/
src/log_logstash.c
@@
-49,7
+49,7
@@
static int log_level = LOG_INFO;
static pthread_mutex_t file_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t file_lock = PTHREAD_MUTEX_INITIALIZER;
-static char *log_file
= NULL
;
+static char *log_file;
static const char *config_keys[] = {"LogLevel", "File"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
static const char *config_keys[] = {"LogLevel", "File"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
diff --git
a/src/logfile.c
b/src/logfile.c
index
ee2ed5c
..
2b7fbae
100644
(file)
--- a/
src/logfile.c
+++ b/
src/logfile.c
@@
-39,7
+39,7
@@
static int log_level = LOG_INFO;
static pthread_mutex_t file_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t file_lock = PTHREAD_MUTEX_INITIALIZER;
-static char *log_file
= NULL
;
+static char *log_file;
static int print_timestamp = 1;
static int print_severity = 0;
static int print_timestamp = 1;
static int print_severity = 0;
diff --git
a/src/madwifi.c
b/src/madwifi.c
index
1a387b7
..
9d1db55
100644
(file)
--- a/
src/madwifi.c
+++ b/
src/madwifi.c
@@
-99,8
+99,8
@@
#error "No applicable input method."
#endif
#error "No applicable input method."
#endif
-#include <linux/wireless.h>
#include "madwifi.h"
#include "madwifi.h"
+#include <linux/wireless.h>
struct stat_spec {
uint16_t flags;
struct stat_spec {
uint16_t flags;
@@
-347,7
+347,7
@@
static const char *config_keys[] = {"Interface", "IgnoreSelected", "Source",
"MiscAdd", "MiscRemove", "MiscSet"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
"MiscAdd", "MiscRemove", "MiscSet"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static ignorelist_t *ignorelist
= NULL
;
+static ignorelist_t *ignorelist;
static int use_sysfs = 1;
static int init_state = 0;
static int use_sysfs = 1;
static int init_state = 0;
diff --git
a/src/mbmon.c
b/src/mbmon.c
index
f58d01e
..
63a300d
100644
(file)
--- a/
src/mbmon.c
+++ b/
src/mbmon.c
@@
-38,8
+38,8
@@
static const char *config_keys[] = {"Host", "Port", NULL};
static int config_keys_num = 2;
static const char *config_keys[] = {"Host", "Port", NULL};
static int config_keys_num = 2;
-static char *mbmon_host
= NULL
;
-static char *mbmon_port
= NULL
;
+static char *mbmon_host;
+static char *mbmon_port;
/*
* NAME
/*
* NAME
diff --git
a/src/md.c
b/src/md.c
index
b8df328
..
0a015c7
100644
(file)
--- a/
src/md.c
+++ b/
src/md.c
@@
-40,7
+40,7
@@
static const char *config_keys[] = {"Device", "IgnoreSelected"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
static const char *config_keys[] = {"Device", "IgnoreSelected"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static ignorelist_t *ignorelist
= NULL
;
+static ignorelist_t *ignorelist;
static int md_config(const char *key, const char *value) {
if (ignorelist == NULL)
static int md_config(const char *key, const char *value) {
if (ignorelist == NULL)
diff --git
a/src/memcachec.c
b/src/memcachec.c
index
bd088ec
..
13e388e
100644
(file)
--- a/
src/memcachec.c
+++ b/
src/memcachec.c
@@
-68,7
+68,7
@@
struct web_page_s /* {{{ */
/*
* Global variables;
*/
/*
* Global variables;
*/
-static web_page_t *pages_g
= NULL
;
+static web_page_t *pages_g;
/*
* Private functions
/*
* Private functions
@@
-412,7
+412,7
@@
static void cmc_submit(const web_page_t *wp, const web_match_t *wm, /* {{{ */
vl.values = &value;
vl.values_len = 1;
sstrncpy(vl.plugin, (wp->plugin_name != NULL) ? wp->plugin_name : "memcachec",
vl.values = &value;
vl.values_len = 1;
sstrncpy(vl.plugin, (wp->plugin_name != NULL) ? wp->plugin_name : "memcachec",
- sizeof
(vl.plugin));
+ sizeof(vl.plugin));
sstrncpy(vl.plugin_instance, wp->instance, sizeof(vl.plugin_instance));
sstrncpy(vl.type, wm->type, sizeof(vl.type));
sstrncpy(vl.type_instance, wm->instance, sizeof(vl.type_instance));
sstrncpy(vl.plugin_instance, wp->instance, sizeof(vl.plugin_instance));
sstrncpy(vl.type, wm->type, sizeof(vl.type));
sstrncpy(vl.type_instance, wm->instance, sizeof(vl.type_instance));
diff --git
a/src/mic.c
b/src/mic.c
index
b65679e
..
0c4ace6
100644
(file)
--- a/
src/mic.c
+++ b/
src/mic.c
@@
-36,7
+36,7
@@
static MicDeviceOnSystem mics[MAX_MICS];
static U32 num_mics = 0;
static MicDeviceOnSystem mics[MAX_MICS];
static U32 num_mics = 0;
-static HANDLE mic_handle
= NULL
;
+static HANDLE mic_handle;
static int const therm_ids[] = {
eMicThermalDie, eMicThermalDevMem, eMicThermalFin, eMicThermalFout,
static int const therm_ids[] = {
eMicThermalDie, eMicThermalDevMem, eMicThermalFin, eMicThermalFout,
@@
-54,9
+54,9
@@
static bool show_cpu = true;
static bool show_cpu_cores = true;
static bool show_memory = true;
static bool show_temps = true;
static bool show_cpu_cores = true;
static bool show_memory = true;
static bool show_temps = true;
-static ignorelist_t *temp_ignore
= NULL
;
+static ignorelist_t *temp_ignore;
static bool show_power = true;
static bool show_power = true;
-static ignorelist_t *power_ignore
= NULL
;
+static ignorelist_t *power_ignore;
static int mic_init(void) {
U32 ret;
static int mic_init(void) {
U32 ret;
diff --git
a/src/modbus.c
b/src/modbus.c
index
2b5e687
..
efcf6be
100644
(file)
--- a/
src/modbus.c
+++ b/
src/modbus.c
@@
-152,7
+152,7
@@
struct mb_data_group_s /* {{{ */
/*
* Global variables
*/
/*
* Global variables
*/
-static mb_data_t *data_definitions
= NULL
;
+static mb_data_t *data_definitions;
/*
* Functions
/*
* Functions
diff --git
a/src/mqtt.c
b/src/mqtt.c
index
3d89f40
..
9e56827
100644
(file)
--- a/
src/mqtt.c
+++ b/
src/mqtt.c
@@
-88,7
+88,7
@@
struct mqtt_client_conf {
};
typedef struct mqtt_client_conf mqtt_client_conf_t;
};
typedef struct mqtt_client_conf mqtt_client_conf_t;
-static mqtt_client_conf_t **subscribers
= NULL
;
+static mqtt_client_conf_t **subscribers;
static size_t subscribers_num = 0;
/*
static size_t subscribers_num = 0;
/*
diff --git
a/src/netlink.c
b/src/netlink.c
index
67fbe55
..
e99e38b
100644
(file)
--- a/
src/netlink.c
+++ b/
src/netlink.c
@@
-92,11
+92,11
@@
struct qos_stats {
};
static int ir_ignorelist_invert = 1;
};
static int ir_ignorelist_invert = 1;
-static ir_ignorelist_t *ir_ignorelist_head
= NULL
;
+static ir_ignorelist_t *ir_ignorelist_head;
static struct mnl_socket *nl;
static struct mnl_socket *nl;
-static char **iflist
= NULL
;
+static char **iflist;
static size_t iflist_len = 0;
static const char *config_keys[] = {"Interface", "VerboseInterface",
static size_t iflist_len = 0;
static const char *config_keys[] = {"Interface", "VerboseInterface",
diff --git
a/src/network.c
b/src/network.c
index
ab5ff29
..
abed5b8
100644
(file)
--- a/
src/network.c
+++ b/
src/network.c
@@
-267,16
+267,16
@@
static size_t network_config_packet_size = 1452;
static bool network_config_forward;
static bool network_config_stats;
static bool network_config_forward;
static bool network_config_stats;
-static sockent_t *sending_sockets
= NULL
;
+static sockent_t *sending_sockets;
-static receive_list_entry_t *receive_list_head
= NULL
;
-static receive_list_entry_t *receive_list_tail
= NULL
;
+static receive_list_entry_t *receive_list_head;
+static receive_list_entry_t *receive_list_tail;
static pthread_mutex_t receive_list_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t receive_list_cond = PTHREAD_COND_INITIALIZER;
static uint64_t receive_list_length = 0;
static pthread_mutex_t receive_list_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t receive_list_cond = PTHREAD_COND_INITIALIZER;
static uint64_t receive_list_length = 0;
-static sockent_t *listen_sockets
= NULL
;
-static struct pollfd *listen_sockets_pollfd
= NULL
;
+static sockent_t *listen_sockets;
+static struct pollfd *listen_sockets_pollfd;
static size_t listen_sockets_num = 0;
/* The receive and dispatch threads will run as long as `listen_loop' is set to
static size_t listen_sockets_num = 0;
/* The receive and dispatch threads will run as long as `listen_loop' is set to
diff --git
a/src/nginx.c
b/src/nginx.c
index
88118b9
..
23feb1c
100644
(file)
--- a/
src/nginx.c
+++ b/
src/nginx.c
@@
-33,15
+33,15
@@
#include <curl/curl.h>
#include <curl/curl.h>
-static char *url
= NULL
;
-static char *user
= NULL
;
-static char *pass
= NULL
;
-static char *verify_peer
= NULL
;
-static char *verify_host
= NULL
;
-static char *cacert
= NULL
;
-static char *timeout
= NULL
;
-
-static CURL *curl
= NULL
;
+static char *url;
+static char *user;
+static char *pass;
+static char *verify_peer;
+static char *verify_host;
+static char *cacert;
+static char *timeout;
+
+static CURL *curl;
static char nginx_buffer[16384];
static size_t nginx_buffer_len = 0;
static char nginx_buffer[16384];
static size_t nginx_buffer_len = 0;
diff --git
a/src/notify_email.c
b/src/notify_email.c
index
52cc838
..
eb9ec00
100644
(file)
--- a/
src/notify_email.c
+++ b/
src/notify_email.c
@@
-43,14
+43,14
@@
static int recipients_len = 0;
static smtp_session_t session;
static pthread_mutex_t session_lock = PTHREAD_MUTEX_INITIALIZER;
static smtp_message_t message;
static smtp_session_t session;
static pthread_mutex_t session_lock = PTHREAD_MUTEX_INITIALIZER;
static smtp_message_t message;
-static auth_context_t authctx
= NULL
;
+static auth_context_t authctx;
static int smtp_port = 25;
static int smtp_port = 25;
-static char *smtp_host
= NULL
;
-static char *smtp_user
= NULL
;
-static char *smtp_password
= NULL
;
-static char *email_from
= NULL
;
-static char *email_subject
= NULL
;
+static char *smtp_host;
+static char *smtp_user;
+static char *smtp_password;
+static char *email_from;
+static char *email_subject;
#define DEFAULT_SMTP_HOST "localhost"
#define DEFAULT_SMTP_FROM "root@localhost"
#define DEFAULT_SMTP_HOST "localhost"
#define DEFAULT_SMTP_FROM "root@localhost"
diff --git
a/src/ntpd.c
b/src/ntpd.c
index
8976866
..
baa1988
100644
(file)
--- a/
src/ntpd.c
+++ b/
src/ntpd.c
@@
-66,7
+66,7
@@
static bool include_unit_id;
#define NTPD_DEFAULT_HOST "localhost"
#define NTPD_DEFAULT_PORT "123"
static int sock_descr = -1;
#define NTPD_DEFAULT_HOST "localhost"
#define NTPD_DEFAULT_PORT "123"
static int sock_descr = -1;
-static char *ntpd_host
= NULL
;
+static char *ntpd_host;
static char ntpd_port[16];
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
static char ntpd_port[16];
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
diff --git
a/src/nut.c
b/src/nut.c
index
58c7d79
..
a51c4c0
100644
(file)
--- a/
src/nut.c
+++ b/
src/nut.c
@@
-57,7
+57,7
@@
static int force_ssl = 0; // Initialized to default of 0 (false)
static int verify_peer = 0; // Initialized to default of 0 (false)
static int ssl_flags = UPSCLI_CONN_TRYSSL;
static int connect_timeout = -1;
static int verify_peer = 0; // Initialized to default of 0 (false)
static int ssl_flags = UPSCLI_CONN_TRYSSL;
static int connect_timeout = -1;
-static char *ca_path
= NULL
;
+static char *ca_path;
static int nut_read(user_data_t *user_data);
static int nut_read(user_data_t *user_data);
diff --git
a/src/olsrd.c
b/src/olsrd.c
index
eb64077
..
df05288
100644
(file)
--- a/
src/olsrd.c
+++ b/
src/olsrd.c
@@
-41,8
+41,8
@@
static const char *config_keys[] = {"Host", "Port", "CollectLinks",
"CollectRoutes", "CollectTopology"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
"CollectRoutes", "CollectTopology"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static char *config_node
= NULL
;
-static char *config_service
= NULL
;
+static char *config_node;
+static char *config_service;
#define OLSRD_WANT_NOT 0
#define OLSRD_WANT_SUMMARY 1
#define OLSRD_WANT_NOT 0
#define OLSRD_WANT_SUMMARY 1
diff --git
a/src/onewire.c
b/src/onewire.c
index
37112ad
..
b1d4cbe
100644
(file)
--- a/
src/onewire.c
+++ b/
src/onewire.c
@@
-86,7
+86,7
@@
static ow_family_features_t ow_family_features[] = {
/* features_num = */ 1}};
static int ow_family_features_num = STATIC_ARRAY_SIZE(ow_family_features);
/* features_num = */ 1}};
static int ow_family_features_num = STATIC_ARRAY_SIZE(ow_family_features);
-static char *device_g
= NULL
;
+static char *device_g;
static cdtime_t ow_interval = 0;
static bool direct_access;
static cdtime_t ow_interval = 0;
static bool direct_access;
@@
-109,7
+109,7
@@
typedef struct direct_access_element_s {
struct direct_access_element_s *next; /**< Next in the list */
} direct_access_element_t;
struct direct_access_element_s *next; /**< Next in the list */
} direct_access_element_t;
-static direct_access_element_t *direct_list
= NULL
;
+static direct_access_element_t *direct_list;
/* ===================================================================================
*/
/* ===================================================================================
*/
diff --git
a/src/oracle.c
b/src/oracle.c
index
bf6aef5
..
9c4b929
100644
(file)
--- a/
src/oracle.c
+++ b/
src/oracle.c
@@
-75,9
+75,9
@@
typedef struct o_database_s o_database_t;
/*
* Global variables
*/
/*
* Global variables
*/
-static udb_query_t **queries
= NULL
;
+static udb_query_t **queries;
static size_t queries_num = 0;
static size_t queries_num = 0;
-static o_database_t **databases
= NULL
;
+static o_database_t **databases;
static size_t databases_num = 0;
OCIEnv *oci_env = NULL;
static size_t databases_num = 0;
OCIEnv *oci_env = NULL;
diff --git
a/src/perl.c
b/src/perl.c
index
6683b4c
..
d760b41
100644
(file)
--- a/
src/perl.c
+++ b/
src/perl.c
@@
-187,13
+187,13
@@
static bool register_legacy_flush = true;
/* if perl_threads != NULL perl_threads->head must
* point to the "base" thread */
/* if perl_threads != NULL perl_threads->head must
* point to the "base" thread */
-static c_ithread_list_t *perl_threads
= NULL
;
+static c_ithread_list_t *perl_threads;
/* the key used to store each pthread's ithread */
static pthread_key_t perl_thr_key;
static int perl_argc = 0;
/* the key used to store each pthread's ithread */
static pthread_key_t perl_thr_key;
static int perl_argc = 0;
-static char **perl_argv
= NULL
;
+static char **perl_argv;
static char base_name[DATA_MAX_NAME_LEN] = "";
static char base_name[DATA_MAX_NAME_LEN] = "";
diff --git
a/src/pinba.c
b/src/pinba.c
index
e82ac0e
..
a323b45
100644
(file)
--- a/
src/pinba.c
+++ b/
src/pinba.c
@@
-99,12
+99,12
@@
typedef struct pinba_statnode_s pinba_statnode_t;
* Module global variables
*/
/* {{{ */
* Module global variables
*/
/* {{{ */
-static pinba_statnode_t *stat_nodes
= NULL
;
+static pinba_statnode_t *stat_nodes;
static unsigned int stat_nodes_num = 0;
static pthread_mutex_t stat_nodes_lock;
static unsigned int stat_nodes_num = 0;
static pthread_mutex_t stat_nodes_lock;
-static char *conf_node
= NULL
;
-static char *conf_service
= NULL
;
+static char *conf_node;
+static char *conf_service;
static bool collector_thread_running;
static bool collector_thread_do_shutdown;
static bool collector_thread_running;
static bool collector_thread_do_shutdown;
diff --git
a/src/ping.c
b/src/ping.c
index
565ae99
..
f89c830
100644
(file)
--- a/
src/ping.c
+++ b/
src/ping.c
@@
-69,14
+69,14
@@
typedef struct hostlist_s hostlist_t;
/*
* Private variables
*/
/*
* Private variables
*/
-static hostlist_t *hostlist_head
= NULL
;
+static hostlist_t *hostlist_head;
static int ping_af = PING_DEF_AF;
static int ping_af = PING_DEF_AF;
-static char *ping_source
= NULL
;
+static char *ping_source;
#ifdef HAVE_OPING_1_3
#ifdef HAVE_OPING_1_3
-static char *ping_device
= NULL
;
+static char *ping_device;
#endif
#endif
-static char *ping_data
= NULL
;
+static char *ping_data;
static int ping_ttl = PING_DEF_TTL;
static double ping_interval = 1.0;
static double ping_timeout = 0.9;
static int ping_ttl = PING_DEF_TTL;
static double ping_interval = 1.0;
static double ping_timeout = 0.9;
diff --git
a/src/postgresql.c
b/src/postgresql.c
index
f626b57
..
9adba7d
100644
(file)
--- a/
src/postgresql.c
+++ b/
src/postgresql.c
@@
-155,13
+155,13
@@
static const char *const def_queries[] = {
"table_states", "disk_io", "disk_usage"};
static int def_queries_num = STATIC_ARRAY_SIZE(def_queries);
"table_states", "disk_io", "disk_usage"};
static int def_queries_num = STATIC_ARRAY_SIZE(def_queries);
-static c_psql_database_t **databases
= NULL
;
+static c_psql_database_t **databases;
static size_t databases_num = 0;
static size_t databases_num = 0;
-static udb_query_t **queries
= NULL
;
+static udb_query_t **queries;
static size_t queries_num = 0;
static size_t queries_num = 0;
-static c_psql_writer_t *writers
= NULL
;
+static c_psql_writer_t *writers;
static size_t writers_num = 0;
static int c_psql_begin(c_psql_database_t *db) {
static size_t writers_num = 0;
static int c_psql_begin(c_psql_database_t *db) {
diff --git
a/src/powerdns.c
b/src/powerdns.c
index
729a15b
..
eb3ec53
100644
(file)
--- a/
src/powerdns.c
+++ b/
src/powerdns.c
@@
-304,10
+304,10
@@
static statname_lookup_t lookup_table[] = /* {{{ */
{"uptime", "uptime", NULL}}; /* }}} */
static int lookup_table_length = STATIC_ARRAY_SIZE(lookup_table);
{"uptime", "uptime", NULL}}; /* }}} */
static int lookup_table_length = STATIC_ARRAY_SIZE(lookup_table);
-static llist_t *list
= NULL
;
+static llist_t *list;
#define PDNS_LOCAL_SOCKPATH LOCALSTATEDIR "/run/" PACKAGE_NAME "-powerdns"
#define PDNS_LOCAL_SOCKPATH LOCALSTATEDIR "/run/" PACKAGE_NAME "-powerdns"
-static char *local_sockpath
= NULL
;
+static char *local_sockpath;
/* TODO: Do this before 4.4:
* - Update the collectd.conf(5) manpage.
/* TODO: Do this before 4.4:
* - Update the collectd.conf(5) manpage.
diff --git
a/src/processes.c
b/src/processes.c
index
2a4ce1f
..
cfc5790
100644
(file)
--- a/
src/processes.c
+++ b/
src/processes.c
@@
-293,7
+293,7
@@
typedef struct procstat {
struct procstat_entry_s *instances;
} procstat_t;
struct procstat_entry_s *instances;
} procstat_t;
-static procstat_t *list_head_g
= NULL
;
+static procstat_t *list_head_g;
static bool want_init = true;
static bool report_ctx_switch;
static bool want_init = true;
static bool report_ctx_switch;
@@
-334,7
+334,7
@@
int getargs(void *processBuffer, int bufferLen, char *argsBuffer, int argsLen);
#endif /* HAVE_PROCINFO_H */
#if HAVE_LIBTASKSTATS
#endif /* HAVE_PROCINFO_H */
#if HAVE_LIBTASKSTATS
-static ts_t *taskstats_handle
= NULL
;
+static ts_t *taskstats_handle;
#endif
/* put name of process from config to list_head_g tree
#endif
/* put name of process from config to list_head_g tree
diff --git
a/src/protocols.c
b/src/protocols.c
index
a50539e
..
59eb49a
100644
(file)
--- a/
src/protocols.c
+++ b/
src/protocols.c
@@
-45,7
+45,7
@@
static const char *config_keys[] = {
};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static ignorelist_t *values_list
= NULL
;
+static ignorelist_t *values_list;
/*
* Functions
/*
* Functions
diff --git
a/src/pyconfig.c
b/src/pyconfig.c
index
c6e8930
..
4ba7e0d
100644
(file)
--- a/
src/pyconfig.c
+++ b/
src/pyconfig.c
@@
-129,7
+129,7
@@
static int Config_init(PyObject *s, PyObject *args, PyObject *kwds) {
static PyObject *Config_repr(PyObject *s) {
Config *self = (Config *)s;
PyObject *ret = NULL;
static PyObject *Config_repr(PyObject *s) {
Config *self = (Config *)s;
PyObject *ret = NULL;
- static PyObject *node_prefix
= NULL, *root_prefix = NULL, *ending = NULL
;
+ static PyObject *node_prefix
, *root_prefix, *ending
;
/* This is ok because we have the GIL, so this is thread-save by default. */
if (node_prefix == NULL)
/* This is ok because we have the GIL, so this is thread-save by default. */
if (node_prefix == NULL)
diff --git
a/src/pyvalues.c
b/src/pyvalues.c
index
12c8dde
..
301df44
100644
(file)
--- a/
src/pyvalues.c
+++ b/
src/pyvalues.c
@@
-52,9
+52,8
@@
typedef struct {
static PyObject *cpy_common_repr(PyObject *s) {
PyObject *ret, *tmp;
static PyObject *cpy_common_repr(PyObject *s) {
PyObject *ret, *tmp;
- static PyObject *l_type = NULL, *l_type_instance = NULL, *l_plugin = NULL,
- *l_plugin_instance = NULL;
- static PyObject *l_host = NULL, *l_time = NULL;
+ static PyObject *l_type, *l_type_instance, *l_plugin, *l_plugin_instance;
+ static PyObject *l_host, *l_time;
PluginData *self = (PluginData *)s;
if (l_type == NULL)
PluginData *self = (PluginData *)s;
if (l_type == NULL)
@@
-203,7
+202,7
@@
static int PluginData_init(PyObject *s, PyObject *args, PyObject *kwds) {
static PyObject *PluginData_repr(PyObject *s) {
PyObject *ret;
static PyObject *PluginData_repr(PyObject *s) {
PyObject *ret;
- static PyObject *l_closing
= NULL
;
+ static PyObject *l_closing;
if (l_closing == NULL)
l_closing = cpy_string_to_unicode_or_bytes(")");
if (l_closing == NULL)
l_closing = cpy_string_to_unicode_or_bytes(")");
@@
-843,8
+842,7
@@
static PyObject *Values_write(Values *self, PyObject *args, PyObject *kwds) {
static PyObject *Values_repr(PyObject *s) {
PyObject *ret, *tmp;
static PyObject *Values_repr(PyObject *s) {
PyObject *ret, *tmp;
- static PyObject *l_interval = NULL, *l_values = NULL, *l_meta = NULL,
- *l_closing = NULL;
+ static PyObject *l_interval, *l_values, *l_meta, *l_closing;
Values *self = (Values *)s;
if (l_interval == NULL)
Values *self = (Values *)s;
if (l_interval == NULL)
@@
-1146,8
+1144,7
@@
static int Notification_setstring(PyObject *self, PyObject *value, void *data) {
static PyObject *Notification_repr(PyObject *s) {
PyObject *ret, *tmp;
static PyObject *Notification_repr(PyObject *s) {
PyObject *ret, *tmp;
- static PyObject *l_severity = NULL, *l_message = NULL, *l_meta = NULL,
- *l_closing = NULL;
+ static PyObject *l_severity, *l_message, *l_meta, *l_closing;
Notification *self = (Notification *)s;
if (l_severity == NULL)
Notification *self = (Notification *)s;
if (l_severity == NULL)
diff --git
a/src/redis.c
b/src/redis.c
index
7c704ab
..
2d33e2d
100644
(file)
--- a/
src/redis.c
+++ b/
src/redis.c
@@
-76,7
+76,7
@@
struct redis_node_s {
redis_node_t *next;
};
redis_node_t *next;
};
-static redis_node_t *nodes_head
= NULL
;
+static redis_node_t *nodes_head;
static int redis_node_add(const redis_node_t *rn) /* {{{ */
{
static int redis_node_add(const redis_node_t *rn) /* {{{ */
{
diff --git
a/src/rrdcached.c
b/src/rrdcached.c
index
c09e048
..
8b742bb
100644
(file)
--- a/
src/rrdcached.c
+++ b/
src/rrdcached.c
@@
-37,8
+37,8
@@
/*
* Private variables
*/
/*
* Private variables
*/
-static char *datadir
= NULL
;
-static char *daemon_address
= NULL
;
+static char *datadir;
+static char *daemon_address;
static bool config_create_files = true;
static bool config_collect_stats = true;
static rrdcreate_config_t rrdcreate_config = {
static bool config_create_files = true;
static bool config_collect_stats = true;
static rrdcreate_config_t rrdcreate_config = {
diff --git
a/src/rrdtool.c
b/src/rrdtool.c
index
e3ad07e
..
c93e9fc
100644
(file)
--- a/
src/rrdtool.c
+++ b/
src/rrdtool.c
@@
-66,7
+66,7
@@
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
/* If datadir is zero, the daemon's basedir is used. If stepsize or heartbeat
* is zero a default, depending on the `interval' member of the value list is
* being used. */
/* If datadir is zero, the daemon's basedir is used. If stepsize or heartbeat
* is zero a default, depending on the `interval' member of the value list is
* being used. */
-static char *datadir
= NULL
;
+static char *datadir;
static double write_rate = 0.0;
static rrdcreate_config_t rrdcreate_config = {
/* stepsize = */ 0,
static double write_rate = 0.0;
static rrdcreate_config_t rrdcreate_config = {
/* stepsize = */ 0,
@@
-88,13
+88,13
@@
static cdtime_t cache_timeout = 0;
static cdtime_t cache_flush_timeout = 0;
static cdtime_t random_timeout = 0;
static cdtime_t cache_flush_last;
static cdtime_t cache_flush_timeout = 0;
static cdtime_t random_timeout = 0;
static cdtime_t cache_flush_last;
-static c_avl_tree_t *cache
= NULL
;
+static c_avl_tree_t *cache;
static pthread_mutex_t cache_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t cache_lock = PTHREAD_MUTEX_INITIALIZER;
-static rrd_queue_t *queue_head
= NULL
;
-static rrd_queue_t *queue_tail
= NULL
;
-static rrd_queue_t *flushq_head
= NULL
;
-static rrd_queue_t *flushq_tail
= NULL
;
+static rrd_queue_t *queue_head;
+static rrd_queue_t *queue_tail;
+static rrd_queue_t *flushq_head;
+static rrd_queue_t *flushq_tail;
static pthread_t queue_thread;
static int queue_thread_running = 1;
static pthread_mutex_t queue_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_t queue_thread;
static int queue_thread_running = 1;
static pthread_mutex_t queue_lock = PTHREAD_MUTEX_INITIALIZER;
diff --git
a/src/sensors.c
b/src/sensors.c
index
ddd09d9
..
47db4e3
100644
(file)
--- a/
src/sensors.c
+++ b/
src/sensors.c
@@
-157,7
+157,7
@@
typedef struct featurelist {
struct featurelist *next;
} featurelist_t;
struct featurelist *next;
} featurelist_t;
-static char *conffile
= NULL
;
+static char *conffile;
static bool use_labels;
/* #endif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500) */
static bool use_labels;
/* #endif (SENSORS_API_VERSION >= 0x400) && (SENSORS_API_VERSION < 0x500) */
@@
-166,7
+166,7
@@
static bool use_labels;
"as bug."
#endif
"as bug."
#endif
-static featurelist_t *first_feature
= NULL
;
+static featurelist_t *first_feature;
static ignorelist_t *sensor_list;
#if SENSORS_API_VERSION < 0x400
static ignorelist_t *sensor_list;
#if SENSORS_API_VERSION < 0x400
diff --git
a/src/smart.c
b/src/smart.c
index
30680be
..
9f84955
100644
(file)
--- a/
src/smart.c
+++ b/
src/smart.c
@@
-42,7
+42,7
@@
static const char *config_keys[] = {"Disk", "IgnoreSelected", "IgnoreSleepMode",
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static ignorelist_t *ignorelist
= NULL
;
+static ignorelist_t *ignorelist;
static int ignore_sleep_mode = 0;
static int use_serial = 0;
static int ignore_sleep_mode = 0;
static int use_serial = 0;
diff --git
a/src/snmp.c
b/src/snmp.c
index
800c050
..
b616f67
100644
(file)
--- a/
src/snmp.c
+++ b/
src/snmp.c
@@
-115,7
+115,7
@@
typedef struct csnmp_table_values_s csnmp_table_values_t;
/*
* Private variables
*/
/*
* Private variables
*/
-static data_definition_t *data_head
= NULL
;
+static data_definition_t *data_head;
/*
* Prototypes
/*
* Prototypes
diff --git
a/src/snmp_agent.c
b/src/snmp_agent.c
index
0675a76
..
48d9f86
100644
(file)
--- a/
src/snmp_agent.c
+++ b/
src/snmp_agent.c
@@
-90,7
+90,7
@@
struct snmp_agent_ctx_s {
};
typedef struct snmp_agent_ctx_s snmp_agent_ctx_t;
};
typedef struct snmp_agent_ctx_s snmp_agent_ctx_t;
-static snmp_agent_ctx_t *g_agent
= NULL
;
+static snmp_agent_ctx_t *g_agent;
#define CHECK_DD_TYPE(_dd, _p, _pi, _t, _ti) \
(_dd->plugin ? !strcmp(_dd->plugin, _p) : 0) && \
#define CHECK_DD_TYPE(_dd, _p, _pi, _t, _ti) \
(_dd->plugin ? !strcmp(_dd->plugin, _p) : 0) && \
diff --git
a/src/statsd.c
b/src/statsd.c
index
c7b472f
..
28ee337
100644
(file)
--- a/
src/statsd.c
+++ b/
src/statsd.c
@@
-61,22
+61,22
@@
struct statsd_metric_s {
};
typedef struct statsd_metric_s statsd_metric_t;
};
typedef struct statsd_metric_s statsd_metric_t;
-static c_avl_tree_t *metrics_tree
= NULL
;
+static c_avl_tree_t *metrics_tree;
static pthread_mutex_t metrics_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_t network_thread;
static bool network_thread_running;
static bool network_thread_shutdown;
static pthread_mutex_t metrics_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_t network_thread;
static bool network_thread_running;
static bool network_thread_shutdown;
-static char *conf_node
= NULL
;
-static char *conf_service
= NULL
;
+static char *conf_node;
+static char *conf_service;
static bool conf_delete_counters;
static bool conf_delete_timers;
static bool conf_delete_gauges;
static bool conf_delete_sets;
static bool conf_delete_counters;
static bool conf_delete_timers;
static bool conf_delete_gauges;
static bool conf_delete_sets;
-static double *conf_timer_percentile
= NULL
;
+static double *conf_timer_percentile;
static size_t conf_timer_percentile_num;
static bool conf_counter_sum;
static size_t conf_timer_percentile_num;
static bool conf_counter_sum;
diff --git
a/src/swap.c
b/src/swap.c
index
ede638a
..
db0b987
100644
(file)
--- a/
src/swap.c
+++ b/
src/swap.c
@@
-93,7
+93,7
@@
static bool report_by_device;
/* #endif defined(VM_SWAPUSAGE) */
#elif HAVE_LIBKVM_GETSWAPINFO
/* #endif defined(VM_SWAPUSAGE) */
#elif HAVE_LIBKVM_GETSWAPINFO
-static kvm_t *kvm_obj
= NULL
;
+static kvm_t *kvm_obj;
int kvm_pagesize;
/* #endif HAVE_LIBKVM_GETSWAPINFO */
int kvm_pagesize;
/* #endif HAVE_LIBKVM_GETSWAPINFO */
diff --git
a/src/tail.c
b/src/tail.c
index
fbba478
..
3d52380
100644
(file)
--- a/
src/tail.c
+++ b/
src/tail.c
@@
-59,7
+59,7
@@
struct ctail_config_match_s {
};
typedef struct ctail_config_match_s ctail_config_match_t;
};
typedef struct ctail_config_match_s ctail_config_match_t;
-static cu_tail_match_t **tail_match_list
= NULL
;
+static cu_tail_match_t **tail_match_list;
static size_t tail_match_list_num = 0;
static cdtime_t tail_match_list_intervals[255];
static size_t tail_match_list_num = 0;
static cdtime_t tail_match_list_intervals[255];
@@
-134,8
+134,7
@@
static int ctail_config_add_match_dstype(ctail_config_match_t *cm,
return 0;
} /* int ctail_config_add_match_dstype */
return 0;
} /* int ctail_config_add_match_dstype */
-static int ctail_config_add_match(cu_tail_match_t *tm,
- const char *plugin_name,
+static int ctail_config_add_match(cu_tail_match_t *tm, const char *plugin_name,
const char *plugin_instance,
oconfig_item_t *ci, cdtime_t interval) {
ctail_config_match_t cm = {0};
const char *plugin_instance,
oconfig_item_t *ci, cdtime_t interval) {
ctail_config_match_t cm = {0};
@@
-194,8
+193,8
@@
static int ctail_config_add_match(cu_tail_match_t *tm,
// TODO(octo): there's nothing "simple" about the latency stuff …
status = tail_match_add_match_simple(
tm, cm.regex, cm.excluderegex, cm.flags,
// TODO(octo): there's nothing "simple" about the latency stuff …
status = tail_match_add_match_simple(
tm, cm.regex, cm.excluderegex, cm.flags,
- (plugin_name != NULL) ? plugin_name : "tail", plugin_instance,
- cm.type
, cm.type
_instance, cm.latency, interval);
+ (plugin_name != NULL) ? plugin_name : "tail", plugin_instance,
cm.type,
+ cm.type_instance, cm.latency, interval);
if (status != 0)
ERROR("tail plugin: tail_match_add_match_simple failed.");
if (status != 0)
ERROR("tail plugin: tail_match_add_match_simple failed.");
@@
-234,7
+233,7
@@
static int ctail_config_add_file(oconfig_item_t *ci) {
int status = 0;
if (strcasecmp("Plugin", option->key) == 0)
int status = 0;
if (strcasecmp("Plugin", option->key) == 0)
- status = cf_util_get_string
(option, &plugin_name);
+ status = cf_util_get_string(option, &plugin_name);
else if (strcasecmp("Instance", option->key) == 0)
status = cf_util_get_string(option, &plugin_instance);
else if (strcasecmp("Interval", option->key) == 0)
else if (strcasecmp("Instance", option->key) == 0)
status = cf_util_get_string(option, &plugin_instance);
else if (strcasecmp("Interval", option->key) == 0)
diff --git
a/src/tail_csv.c
b/src/tail_csv.c
index
ff96705
..
be7cd40
100644
(file)
--- a/
src/tail_csv.c
+++ b/
src/tail_csv.c
@@
-57,7
+57,7
@@
struct instance_definition_s {
typedef struct instance_definition_s instance_definition_t;
/* Private */
typedef struct instance_definition_s instance_definition_t;
/* Private */
-static metric_definition_t *metric_head
= NULL
;
+static metric_definition_t *metric_head;
static int tcsv_submit(instance_definition_t *id, metric_definition_t *md,
value_t v, cdtime_t t) {
static int tcsv_submit(instance_definition_t *id, metric_definition_t *md,
value_t v, cdtime_t t) {
diff --git
a/src/tcpconns.c
b/src/tcpconns.c
index
50d8efb
..
07170d7
100644
(file)
--- a/
src/tcpconns.c
+++ b/
src/tcpconns.c
@@
-263,7
+263,7
@@
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
static int port_collect_listening = 0;
static int port_collect_total = 0;
static int port_collect_listening = 0;
static int port_collect_total = 0;
-static port_entry_t *port_list_head
= NULL
;
+static port_entry_t *port_list_head;
static uint32_t count_total[TCP_STATE_MAX + 1];
#if KERNEL_LINUX
static uint32_t count_total[TCP_STATE_MAX + 1];
#if KERNEL_LINUX
diff --git
a/src/teamspeak2.c
b/src/teamspeak2.c
index
ae9200c
..
6d0cdbb
100644
(file)
--- a/
src/teamspeak2.c
+++ b/
src/teamspeak2.c
@@
-46,14
+46,14
@@
typedef struct vserver_list_s {
int port;
struct vserver_list_s *next;
} vserver_list_t;
int port;
struct vserver_list_s *next;
} vserver_list_t;
-static vserver_list_t *server_list
= NULL
;
+static vserver_list_t *server_list;
/* Host data */
/* Host data */
-static char *config_host
= NULL
;
-static char *config_port
= NULL
;
+static char *config_host;
+static char *config_port;
-static FILE *global_read_fh
= NULL
;
-static FILE *global_write_fh
= NULL
;
+static FILE *global_read_fh;
+static FILE *global_write_fh;
/* Config data */
static const char *config_keys[] = {"Host", "Port", "Server"};
/* Config data */
static const char *config_keys[] = {"Host", "Port", "Server"};
diff --git
a/src/ted.c
b/src/ted.c
index
b803681
..
21d6357
100644
(file)
--- a/
src/ted.c
+++ b/
src/ted.c
@@
-53,7
+53,7
@@
#define DEFAULT_DEVICE "/dev/ttyUSB0"
#define DEFAULT_DEVICE "/dev/ttyUSB0"
-static char *conf_device
= NULL
;
+static char *conf_device;
static int conf_retries = 0;
static int fd = -1;
static int conf_retries = 0;
static int fd = -1;
diff --git
a/src/tokyotyrant.c
b/src/tokyotyrant.c
index
1534f51
..
aca0a4e
100644
(file)
--- a/
src/tokyotyrant.c
+++ b/
src/tokyotyrant.c
@@
-33,10
+33,10
@@
static const char *config_keys[] = {"Host", "Port"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
static const char *config_keys[] = {"Host", "Port"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static char *config_host
= NULL
;
-static char *config_port
= NULL
;
+static char *config_host;
+static char *config_port;
-static TCRDB *rdb
= NULL
;
+static TCRDB *rdb;
static int tt_config(const char *key, const char *value) {
if (strcasecmp("Host", key) == 0) {
static int tt_config(const char *key, const char *value) {
if (strcasecmp("Host", key) == 0) {
diff --git
a/src/unixsock.c
b/src/unixsock.c
index
be80a3a
..
be2af75
100644
(file)
--- a/
src/unixsock.c
+++ b/
src/unixsock.c
@@
-59,8
+59,8
@@
static int loop = 0;
/* socket configuration */
static int sock_fd = -1;
/* socket configuration */
static int sock_fd = -1;
-static char *sock_file
= NULL
;
-static char *sock_group
= NULL
;
+static char *sock_file;
+static char *sock_group;
static int sock_perms = S_IRWXU | S_IRWXG;
static bool delete_socket;
static int sock_perms = S_IRWXU | S_IRWXG;
static bool delete_socket;
diff --git
a/src/utils_dns.c
b/src/utils_dns.c
index
e7e04f7
..
faa917f
100644
(file)
--- a/
src/utils_dns.c
+++ b/
src/utils_dns.c
@@
-158,13
+158,13
@@
typedef int(printer)(const char *, ...);
*/
#if HAVE_PCAP_H
*/
#if HAVE_PCAP_H
-static pcap_t *pcap_obj
= NULL
;
+static pcap_t *pcap_obj;
#endif
#endif
-static ip_list_t *IgnoreList
= NULL
;
+static ip_list_t *IgnoreList;
#if HAVE_PCAP_H
#if HAVE_PCAP_H
-static void (*Callback)(const rfc1035_header_t *)
= NULL
;
+static void (*Callback)(const rfc1035_header_t *);
static int query_count_intvl = 0;
static int query_count_total = 0;
static int query_count_intvl = 0;
static int query_count_total = 0;
diff --git
a/src/utils_rrdcreate.c
b/src/utils_rrdcreate.c
index
ef12601
..
ce7838d
100644
(file)
--- a/
src/utils_rrdcreate.c
+++ b/
src/utils_rrdcreate.c
@@
-61,7
+61,7
@@
static int rra_types_num = STATIC_ARRAY_SIZE(rra_types);
static pthread_mutex_t librrd_lock = PTHREAD_MUTEX_INITIALIZER;
#endif
static pthread_mutex_t librrd_lock = PTHREAD_MUTEX_INITIALIZER;
#endif
-static async_create_file_t *async_creation_list
= NULL
;
+static async_create_file_t *async_creation_list;
static pthread_mutex_t async_creation_lock = PTHREAD_MUTEX_INITIALIZER;
/*
static pthread_mutex_t async_creation_lock = PTHREAD_MUTEX_INITIALIZER;
/*
diff --git
a/src/uuid.c
b/src/uuid.c
index
1cb9027
..
39b1fe6
100644
(file)
--- a/
src/uuid.c
+++ b/
src/uuid.c
@@
-37,7
+37,7
@@
#define UUID_PRINTABLE_COMPACT_LENGTH (UUID_RAW_LENGTH * 2)
#define UUID_PRINTABLE_NORMAL_LENGTH (UUID_PRINTABLE_COMPACT_LENGTH + 4)
#define UUID_PRINTABLE_COMPACT_LENGTH (UUID_RAW_LENGTH * 2)
#define UUID_PRINTABLE_NORMAL_LENGTH (UUID_PRINTABLE_COMPACT_LENGTH + 4)
-static char *uuidfile
= NULL
;
+static char *uuidfile;
static const char *config_keys[] = {"UUIDFile"};
static const char *config_keys[] = {"UUIDFile"};
diff --git
a/src/virt.c
b/src/virt.c
index
69a35a7
..
cdb7141
100644
(file)
--- a/
src/virt.c
+++ b/
src/virt.c
@@
-242,7
+242,7
@@
const char *domain_reasons[][DOMAIN_STATE_REASON_MAX_SIZE] = {
/* Connection. */
static virConnectPtr conn = 0;
/* Connection. */
static virConnectPtr conn = 0;
-static char *conn_string
= NULL
;
+static char *conn_string;
static c_complain_t conn_complain = C_COMPLAIN_INIT_STATIC;
/* Node information required for %CPU */
static c_complain_t conn_complain = C_COMPLAIN_INIT_STATIC;
/* Node information required for %CPU */
@@
-252,11
+252,11
@@
static virNodeInfo nodeinfo;
static int interval = 60;
/* List of domains, if specified. */
static int interval = 60;
/* List of domains, if specified. */
-static ignorelist_t *il_domains
= NULL
;
+static ignorelist_t *il_domains;
/* List of block devices, if specified. */
/* List of block devices, if specified. */
-static ignorelist_t *il_block_devices
= NULL
;
+static ignorelist_t *il_block_devices;
/* List of network interface devices, if specified. */
/* List of network interface devices, if specified. */
-static ignorelist_t *il_interface_devices
= NULL
;
+static ignorelist_t *il_interface_devices;
static int ignore_device_match(ignorelist_t *, const char *domname,
const char *devpath);
static int ignore_device_match(ignorelist_t *, const char *domname,
const char *devpath);
diff --git
a/src/write_sensu.c
b/src/write_sensu.c
index
99885a6
..
3b4a574
100644
(file)
--- a/
src/write_sensu.c
+++ b/
src/write_sensu.c
@@
-119,8
+119,8
@@
struct sensu_host {
int reference_count;
};
int reference_count;
};
-static char *sensu_tags
= NULL
;
-static char **sensu_attrs
= NULL
;
+static char *sensu_tags;
+static char **sensu_attrs;
static size_t sensu_attrs_num;
static int add_str_to_list(struct str_list *strs,
static size_t sensu_attrs_num;
static int add_str_to_list(struct str_list *strs,
diff --git
a/src/zookeeper.c
b/src/zookeeper.c
index
1de01d0
..
a99bbc0
100644
(file)
--- a/
src/zookeeper.c
+++ b/
src/zookeeper.c
@@
-37,8
+37,8
@@
#define ZOOKEEPER_DEF_HOST "127.0.0.1"
#define ZOOKEEPER_DEF_PORT "2181"
#define ZOOKEEPER_DEF_HOST "127.0.0.1"
#define ZOOKEEPER_DEF_PORT "2181"
-static char *zk_host
= NULL
;
-static char *zk_port
= NULL
;
+static char *zk_host;
+static char *zk_port;
static const char *config_keys[] = {"Host", "Port"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
static const char *config_keys[] = {"Host", "Port"};
static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);