Merge pull request #2772 from rubenk/static-initializers
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Mon, 14 May 2018 12:52:04 +0000 (14:52 +0200)
committerGitHub <noreply@github.com>
Mon, 14 May 2018 12:52:04 +0000 (14:52 +0200)
Don't initialize static pointers to NULL

99 files changed:
src/aggregation.c
src/amqp.c
src/apcups.c
src/aquaero.c
src/ascent.c
src/barometer.c
src/bind.c
src/ceph.c
src/cgroups.c
src/collectd-nagios.c
src/collectd-tg.c
src/collectdmon.c
src/conntrack.c
src/cpu.c
src/cpufreq.c
src/csv.c
src/curl.c
src/daemon/collectd.c
src/daemon/configfile.c
src/daemon/filter_chain.c
src/daemon/plugin.c
src/daemon/utils_avltree_test.c
src/daemon/utils_cache.c
src/dbi.c
src/df.c
src/disk.c
src/dns.c
src/email.c
src/ethstat.c
src/exec.c
src/filecount.c
src/gmond.c
src/hddtemp.c
src/intel_rdt.c
src/interface.c
src/ipmi.c
src/iptables.c
src/irq.c
src/java.c
src/libcollectdclient/network_buffer.c
src/libcollectdclient/network_parse.c
src/log_logstash.c
src/logfile.c
src/madwifi.c
src/mbmon.c
src/md.c
src/memcachec.c
src/mic.c
src/modbus.c
src/mqtt.c
src/netlink.c
src/network.c
src/nfs.c
src/nginx.c
src/notify_email.c
src/ntpd.c
src/nut.c
src/olsrd.c
src/onewire.c
src/oracle.c
src/perl.c
src/pinba.c
src/ping.c
src/postgresql.c
src/powerdns.c
src/processes.c
src/protocols.c
src/pyconfig.c
src/python.c
src/pyvalues.c
src/redis.c
src/rrdcached.c
src/rrdtool.c
src/sensors.c
src/smart.c
src/snmp.c
src/snmp_agent.c
src/statsd.c
src/swap.c
src/syslog.c
src/tail.c
src/tail_csv.c
src/tape.c
src/tcpconns.c
src/teamspeak2.c
src/ted.c
src/testing.h
src/tokyotyrant.c
src/unixsock.c
src/utils_dns.c
src/utils_ovs.c
src/utils_rrdcreate.c
src/uuid.c
src/virt.c
src/vmem.c
src/vserver.c
src/write_sensu.c
src/write_tsdb.c
src/zookeeper.c

index 7d35d41..a802199 100644 (file)
@@ -83,10 +83,10 @@ struct agg_instance_s /* {{{ */
   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 agg_instance_t *agg_instance_list_head = NULL;
+static agg_instance_t *agg_instance_list_head;
 
 static bool agg_is_regex(char const *str) /* {{{ */
 {
index 1557923..281130b 100644 (file)
@@ -111,8 +111,8 @@ static const char *def_user = "guest";
 static const char *def_password = "guest";
 static const char *def_exchange = "amq.fanout";
 
-static pthread_t *subscriber_threads = NULL;
-static size_t subscriber_threads_num = 0;
+static pthread_t *subscriber_threads;
+static size_t subscriber_threads_num;
 static bool subscriber_threads_running = true;
 
 #define CONF(c, f) (((c)->f != NULL) ? (c)->f : def_##f)
@@ -396,7 +396,7 @@ static int camqp_setup_queue(camqp_config_t *conf) /* {{{ */
 
 static int camqp_connect(camqp_config_t *conf) /* {{{ */
 {
-  static time_t last_connect_time = 0;
+  static time_t last_connect_time;
 
   amqp_rpc_reply_t reply;
   int status;
index 4b3f7b5..2931d2c 100644 (file)
@@ -70,16 +70,16 @@ typedef struct {
  * 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;
 
 static int global_sockfd = -1;
 
-static int count_retries = 0;
-static int count_iterations = 0;
+static int count_retries;
+static int count_iterations;
 
 static int net_shutdown(int *fd) {
   uint16_t packet_size = 0;
index beffc1a..937742b 100644 (file)
@@ -30,7 +30,7 @@
  * 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++) {
index 36694f6..2235865 100644 (file)
@@ -87,19 +87,19 @@ typedef struct player_info_s player_info_t;
 #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 CURL *curl = NULL;
-
-static char *ascent_buffer = NULL;
-static size_t ascent_buffer_size = 0;
-static size_t ascent_buffer_fill = 0;
+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 *ascent_buffer;
+static size_t ascent_buffer_size;
+static size_t ascent_buffer_fill;
 static char ascent_curl_error[CURL_ERROR_SIZE];
 
 static const char *config_keys[] = {
index e55e3b8..66ab20c 100644 (file)
@@ -177,14 +177,14 @@ static const char *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; /**< pressure offset */
+static double config_temp_offset;  /**< temperature offset */
 
 static double config_altitude = NAN; /**< altitude */
-static int config_normalize = 0;     /**< normalization method */
+static int config_normalize;         /**< normalization method */
 
 static bool configured; /**< the whole plugin config status */
 
@@ -193,7 +193,7 @@ static int i2c_bus_fd = -1; /**< I2C bus device FD */
 static enum Sensor_type sensor_type =
     Sensor_none; /**< detected/used sensor type */
 
-static __s32 mpl3115_oversample = 0; /**< MPL3115 CTRL1 oversample setting */
+static __s32 mpl3115_oversample; /**< MPL3115 CTRL1 oversample setting */
 
 // BMP085 configuration
 static unsigned bmp085_oversampling; /**< BMP085 oversampling (0-3) */
@@ -235,8 +235,8 @@ typedef struct averaging_s {
   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
@@ -317,7 +317,7 @@ typedef struct temperature_list_s {
   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
index cc5aa59..370ebc5 100644 (file)
@@ -106,23 +106,23 @@ typedef struct list_info_ptr_s list_info_ptr_t;
 /* 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_zone_maint_stats = 1;
-static int global_resolver_stats = 0;
+static int global_resolver_stats;
 static int global_memory_stats = 1;
 static int timeout = -1;
 
-static cb_view_t *views = NULL;
-static size_t views_num = 0;
+static cb_view_t *views;
+static size_t views_num;
 
-static CURL *curl = NULL;
+static CURL *curl;
 
-static char *bind_buffer = NULL;
-static size_t bind_buffer_size = 0;
-static size_t bind_buffer_fill = 0;
+static char *bind_buffer;
+static size_t bind_buffer_size;
+static size_t bind_buffer_fill;
 static char bind_curl_error[CURL_ERROR_SIZE];
 
 /* Translation table for the `nsstats' values. */
index 804514c..2622dc7 100644 (file)
@@ -148,7 +148,7 @@ enum perfcounter_type_d {
 };
 
 /** 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 -
@@ -161,10 +161,10 @@ static int long_run_latency_avg = 0;
 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;
+static size_t g_num_daemons;
 
 /**
  * A set of data that we build up in memory while parsing the JSON.
index 5830c7b..7f24d12 100644 (file)
@@ -31,7 +31,7 @@
 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,
index 2c9bf4a..54be36a 100644 (file)
@@ -94,17 +94,17 @@ typedef struct range_s range_t;
 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 char **match_ds_g = NULL;
-static size_t match_ds_num_g = 0;
+static char **match_ds_g;
+static size_t match_ds_num_g;
 
 /* `strdup' is an XSI extension. I don't want to pull in all of XSI just for
  * that, so here's an own implementation.. It's easy enough. The GCC attributes
index 64547b8..9357ce3 100644 (file)
@@ -62,7 +62,7 @@ static const char *conf_service = NET_DEFAULT_PORT;
 
 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;
index 4a7d1a6..089e52b 100644 (file)
 #define WCOREDUMP(s) 0
 #endif /* ! WCOREDUMP */
 
-static int loop = 0;
-static int restart = 0;
+static int loop;
+static int restart;
 
-static const char *pidfile = NULL;
-static pid_t collectd_pid = 0;
+static const char *pidfile;
+static pid_t collectd_pid;
 
 __attribute__((noreturn)) static void exit_usage(const char *name) {
   printf("Usage: %s <options> [-- <collectd options>]\n"
@@ -246,8 +246,8 @@ static void log_status(int status) {
 static void check_respawn(void) {
   time_t t = time(NULL);
 
-  static time_t timestamp = 0;
-  static int counter = 0;
+  static time_t timestamp;
+  static int counter;
 
   if ((t - 120) < timestamp)
     ++counter;
index 3cd2dee..29c7003 100644 (file)
@@ -41,7 +41,7 @@ static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
     Each table/chain combo that will be queried goes into this list
 */
 
-static int old_files = 0;
+static int old_files;
 
 static int conntrack_config(const char *key, const char *value) {
   if (strcmp(key, "OldFiles") == 0)
index 5a32b6b..2a69712 100644 (file)
--- a/src/cpu.c
+++ b/src/cpu.c
@@ -187,12 +187,12 @@ struct cpu_state_s {
 };
 typedef struct cpu_state_s cpu_state_t;
 
-static cpu_state_t *cpu_states = NULL;
-static size_t cpu_states_num = 0; /* #cpu_states allocated */
+static cpu_state_t *cpu_states;
+static size_t cpu_states_num; /* #cpu_states allocated */
 
 /* Highest CPU number in the current iteration. Used by the dispatch logic to
  * determine how many CPUs there were. Reset to 0 by cpu_reset(). */
-static size_t global_cpu_num = 0;
+static size_t global_cpu_num;
 
 static bool report_by_cpu = true;
 static bool report_by_state = true;
index 0139947..851aad4 100644 (file)
@@ -25,7 +25,7 @@
 #include "common.h"
 #include "plugin.h"
 
-static int num_cpu = 0;
+static int num_cpu;
 
 static int cpufreq_init(void) {
   int status;
index f5126d2..be59ede 100644 (file)
--- a/src/csv.c
+++ b/src/csv.c
@@ -33,9 +33,9 @@
 static const char *config_keys[] = {"DataDir", "StoreRates"};
 static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
 
-static char *datadir = NULL;
-static int store_rates = 0;
-static int use_stdio = 0;
+static char *datadir;
+static int store_rates;
+static int use_stdio;
 
 static int value_list_to_string(char *buffer, int buffer_len,
                                 const data_set_t *ds, const value_list_t *vl) {
index 769ba23..4bfd1e4 100644 (file)
@@ -85,8 +85,7 @@ struct web_page_s /* {{{ */
 /*
  * Global variables;
  */
-/* static CURLM *curl = NULL; */
-static web_page_t *pages_g = NULL;
+static web_page_t *pages_g;
 
 /*
  * Private functions
index 1d19be5..a656b37 100644 (file)
@@ -51,7 +51,7 @@
 #define COLLECTD_LOCALE "C"
 #endif
 
-static int loop = 0;
+static int loop;
 
 static void *do_flush(void __attribute__((unused)) * arg) {
   INFO("Flushing all data.");
index e8d1092..2830a86 100644 (file)
@@ -91,8 +91,8 @@ static int dispatch_block_plugin(oconfig_item_t *ci);
 /*
  * 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},
index 1352f5b..a0a7687 100644 (file)
@@ -693,7 +693,7 @@ static int fc_bit_write_invoke(const data_set_t *ds, /* {{{ */
 
 static int fc_init_once(void) /* {{{ */
 {
-  static int done = 0;
+  static int done;
   target_proc_t tproc = {0};
 
   if (done != 0)
index 734e8a0..427a813 100644 (file)
@@ -94,7 +94,7 @@ typedef struct flush_callback_s flush_callback_t;
 /*
  * 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;
@@ -104,41 +104,41 @@ static llist_t *list_shutdown;
 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 char *plugindir = NULL;
+static char *plugindir;
 
 #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 pthread_t *read_threads = NULL;
-static size_t read_threads_num = 0;
+static pthread_t *read_threads;
+static size_t read_threads_num;
 static cdtime_t max_read_interval = DEFAULT_MAX_READ_INTERVAL;
 
 static write_queue_t *write_queue_head;
 static write_queue_t *write_queue_tail;
-static long write_queue_length = 0;
+static long write_queue_length;
 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 size_t write_threads_num = 0;
+static pthread_t *write_threads;
+static size_t write_threads_num;
 
 static pthread_key_t plugin_ctx_key;
 static bool plugin_ctx_key_initialized;
 
-static long write_limit_high = 0;
-static long write_limit_low = 0;
+static long write_limit_high;
+static long write_limit_low;
 
-static derive_t stats_values_dropped = 0;
+static derive_t stats_values_dropped;
 static bool record_statistics;
 
 /*
@@ -2025,7 +2025,7 @@ static double get_drop_probability(void) /* {{{ */
 
 static bool check_drop_value(void) /* {{{ */
 {
-  static cdtime_t last_message_time = 0;
+  static cdtime_t last_message_time;
   static pthread_mutex_t last_message_lock = PTHREAD_MUTEX_INITIALIZER;
 
   double p;
index bb30f9d..3171246 100644 (file)
  *   Florian octo Forster <octo at collectd.org>
  */
 
-#include "common.h" /* STATIC_ARRAY_SIZE */
 #include "collectd.h"
+#include "common.h" /* STATIC_ARRAY_SIZE */
 
 #include "testing.h"
 #include "utils_avltree.h"
 
-static int compare_total_count = 0;
+static int compare_total_count;
+
 #define RESET_COUNTS()                                                         \
   do {                                                                         \
     compare_total_count = 0;                                                   \
index 8e28a5d..610c11e 100644 (file)
@@ -76,7 +76,7 @@ struct uc_iter_s {
   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) {
index 5f8520f..4ef9f8c 100644 (file)
--- a/src/dbi.c
+++ b/src/dbi.c
@@ -83,12 +83,12 @@ typedef struct cdbi_database_s cdbi_database_t; /* }}} */
  * Global variables
  */
 #if !defined(HAVE_LEGACY_LIBDBI) || !HAVE_LEGACY_LIBDBI
-static dbi_inst dbi_instance = 0;
+static dbi_inst dbi_instance;
 #endif
-static udb_query_t **queries = NULL;
-static size_t queries_num = 0;
-static cdbi_database_t **databases = NULL;
-static size_t databases_num = 0;
+static udb_query_t **queries;
+static size_t queries_num;
+static cdbi_database_t **databases;
+static size_t databases_num;
 
 static int cdbi_read_database(user_data_t *ud);
 
@@ -407,7 +407,7 @@ static int cdbi_config(oconfig_item_t *ci) /* {{{ */
 
 static int cdbi_init(void) /* {{{ */
 {
-  static int did_init = 0;
+  static int did_init;
   int status;
 
   if (did_init != 0)
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);
 
-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;
index 962b7c3..206862b 100644 (file)
@@ -126,7 +126,7 @@ static struct gmesh geom_tree;
 #define MAX_NUMDISK 1024
 extern kstat_ctl_t *kc;
 static kstat_t *ksp[MAX_NUMDISK];
-static int numdisk = 0;
+static int numdisk;
 /* #endif HAVE_LIBKSTAT */
 
 #elif defined(HAVE_LIBSTATGRAB)
@@ -145,7 +145,7 @@ static int pnumdisk;
 #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
 
@@ -153,7 +153,7 @@ static const char *config_keys[] = {"Disk", "UseBSDName", "IgnoreSelected",
                                     "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)
index 3ab456b..bd6820f 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 char *pcap_device = NULL;
+static char *pcap_device;
 
 static derive_t tr_queries;
 static derive_t tr_responses;
@@ -66,7 +66,7 @@ static counter_list_t *opcode_list;
 static counter_list_t *rcode_list;
 
 static pthread_t listen_thread;
-static int listen_thread_init = 0;
+static int listen_thread_init;
 /* The `traffic' mutex if for `tr_queries' and `tr_responses' */
 static pthread_mutex_t traffic_mutex = PTHREAD_MUTEX_INITIALIZER;
 static pthread_mutex_t qtype_mutex = PTHREAD_MUTEX_INITIALIZER;
index d94c542..376dd6a 100644 (file)
@@ -111,13 +111,13 @@ static const char *config_keys[] = {"SocketFile", "SocketGroup", "SocketPerms",
 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;
 
 /* state of the plugin */
-static int disabled = 0;
+static int disabled;
 
 /* thread managing "client" connections */
 static pthread_t connector = (pthread_t)0;
@@ -134,7 +134,7 @@ static conn_list_t conns;
 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;
index 316c25f..0d4c7e1 100644 (file)
@@ -48,10 +48,10 @@ struct value_map_s {
 };
 typedef struct value_map_s value_map_t;
 
-static char **interfaces = NULL;
-static size_t interfaces_num = 0;
+static char **interfaces;
+static size_t interfaces_num;
 
-static c_avl_tree_t *value_map = NULL;
+static c_avl_tree_t *value_map;
 
 static bool collect_mapped_only;
 
index 36f2d4d..b145e81 100644 (file)
@@ -80,7 +80,7 @@ typedef struct program_list_and_notification_s {
 /*
  * Private variables
  */
-static program_list_t *pl_head = NULL;
+static program_list_t *pl_head;
 static pthread_mutex_t pl_lock = PTHREAD_MUTEX_INITIALIZER;
 
 /*
index 67308f4..ef1a138 100644 (file)
@@ -60,8 +60,8 @@ struct fc_directory_conf_s {
 };
 typedef struct fc_directory_conf_s fc_directory_conf_t;
 
-static fc_directory_conf_t **directories = NULL;
-static size_t directories_num = 0;
+static fc_directory_conf_t **directories;
+static size_t directories_num;
 
 static void fc_free_dir(fc_directory_conf_t *dir) {
   sfree(dir->path);
index cb005fd..ca65419 100644 (file)
@@ -84,19 +84,19 @@ struct metric_map_s {
 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"
-static char *mc_receive_port = NULL;
+static char *mc_receive_port;
 
-static struct pollfd *mc_receive_sockets = NULL;
-static size_t mc_receive_sockets_num = 0;
+static struct pollfd *mc_receive_sockets;
+static size_t mc_receive_sockets_num;
 
-static socket_entry_t *mc_send_sockets = NULL;
-static size_t mc_send_sockets_num = 0;
+static socket_entry_t *mc_send_sockets;
+static size_t mc_send_sockets_num;
 static pthread_mutex_t mc_send_sockets_lock = PTHREAD_MUTEX_INITIALIZER;
 
-static int mc_receive_thread_loop = 0;
-static int mc_receive_thread_running = 0;
+static int mc_receive_thread_loop;
+static int mc_receive_thread_running;
 static pthread_t mc_receive_thread_id;
 
 static metric_map_t metric_map_default[] =
@@ -122,8 +122,8 @@ 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);
 
-static metric_map_t *metric_map = NULL;
-static size_t metric_map_len = 0;
+static metric_map_t *metric_map;
+static size_t metric_map_len;
 
 static c_avl_tree_t *staging_tree;
 static pthread_mutex_t staging_lock = PTHREAD_MUTEX_INITIALIZER;
index 36c4128..80daf15 100644 (file)
@@ -53,7 +53,7 @@
 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];
 
 /*
index 29c02fe..3d4c988 100644 (file)
@@ -59,7 +59,7 @@ struct rdt_ctx_s {
 };
 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;
 
index 3e2b2cd..86110b0 100644 (file)
@@ -86,7 +86,7 @@ static const char *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;
 
@@ -97,7 +97,7 @@ static bool report_inactive = true;
 #define MAX_NUMIF 256
 extern kstat_ctl_t *kc;
 static kstat_t *ksp[MAX_NUMIF];
-static int numif = 0;
+static int numif;
 static bool unique_name;
 #endif /* HAVE_LIBKSTAT */
 
index 2475278..7f628bf 100644 (file)
@@ -95,8 +95,8 @@ typedef struct c_ipmi_db_type_map_s c_ipmi_db_type_map_t;
 /*
  * 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
index bc75d7b..8fad588 100644 (file)
@@ -86,8 +86,8 @@ typedef struct {
   char name[64];
 } ip_chain_t;
 
-static ip_chain_t **chain_list = NULL;
-static int chain_num = 0;
+static ip_chain_t **chain_list;
+static int chain_num;
 
 static int iptables_config(const char *key, const char *value) {
   /* int ip_value; */
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 ignorelist_t *ignorelist = NULL;
+static ignorelist_t *ignorelist;
 
 /*
  * Private functions
index a35ca46..449e816 100644 (file)
@@ -77,23 +77,23 @@ typedef struct cjni_callback_info_s cjni_callback_info_t;
 /*
  * Global variables
  */
-static JavaVM *jvm = NULL;
+static JavaVM *jvm;
 static pthread_key_t jvm_env_key;
 
 /* Configuration options for the JVM. */
-static char **jvm_argv = NULL;
-static size_t jvm_argc = 0;
+static char **jvm_argv;
+static size_t jvm_argc;
 
 /* 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 cjni_callback_info_t *java_callbacks = NULL;
-static size_t java_callbacks_num = 0;
+static cjni_callback_info_t *java_callbacks;
+static size_t java_callbacks_num;
 static pthread_mutex_t java_callbacks_lock = PTHREAD_MUTEX_INITIALIZER;
 
-static oconfig_item_t *config_block = NULL;
+static oconfig_item_t *config_block;
 
 /*
  * Prototypes
index 373dd2b..5a1ee8d 100644 (file)
@@ -156,7 +156,7 @@ static bool have_gcrypt(void) /* {{{ */
 #ifndef HAVE_HTONLL
 static uint64_t htonll(uint64_t val) /* {{{ */
 {
-  static int config = 0;
+  static int config;
 
   uint32_t hi;
   uint32_t lo;
@@ -186,7 +186,7 @@ static uint64_t htonll(uint64_t val) /* {{{ */
 
 static double htond(double val) /* {{{ */
 {
-  static int config = 0;
+  static int config;
 
   union {
     uint8_t byte[8];
index 91fe18d..34ea219 100644 (file)
@@ -221,7 +221,7 @@ static int parse_time(uint16_t type, void *payload, size_t payload_size,
 
 static double ntohd(double val) /* {{{ */
 {
-  static int config = 0;
+  static int config;
 
   union {
     uint8_t byte[8];
index 2553a28..8f3063f 100644 (file)
@@ -49,7 +49,7 @@ static int log_level = LOG_INFO;
 
 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);
index ee2ed5c..fa56a1b 100644 (file)
@@ -39,9 +39,9 @@ static int log_level = LOG_INFO;
 
 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_severity;
 
 static const char *config_keys[] = {"LogLevel", "File", "Timestamp",
                                     "PrintSeverity"};
index 1a387b7..60ac3c8 100644 (file)
@@ -99,8 +99,8 @@
 #error "No applicable input method."
 #endif
 
-#include <linux/wireless.h>
 #include "madwifi.h"
+#include <linux/wireless.h>
 
 struct stat_spec {
   uint16_t flags;
@@ -347,10 +347,10 @@ static const char *config_keys[] = {"Interface", "IgnoreSelected", "Source",
                                     "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 init_state;
 
 static inline int item_watched(int i) {
   assert(i >= 0);
index f58d01e..63a300d 100644 (file)
@@ -38,8 +38,8 @@
 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
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 ignorelist_t *ignorelist = NULL;
+static ignorelist_t *ignorelist;
 
 static int md_config(const char *key, const char *value) {
   if (ignorelist == NULL)
index bd088ec..13e388e 100644 (file)
@@ -68,7 +68,7 @@ struct web_page_s /* {{{ */
 /*
  * Global variables;
  */
-static web_page_t *pages_g = NULL;
+static web_page_t *pages_g;
 
 /*
  * 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",
-           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));
index b65679e..4f4a9ba 100644 (file)
--- a/src/mic.c
+++ b/src/mic.c
@@ -35,8 +35,8 @@
 #define MAX_CORES 256
 
 static MicDeviceOnSystem mics[MAX_MICS];
-static U32 num_mics = 0;
-static HANDLE mic_handle = NULL;
+static U32 num_mics;
+static HANDLE mic_handle;
 
 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 ignorelist_t *temp_ignore = NULL;
+static ignorelist_t *temp_ignore;
 static bool show_power = true;
-static ignorelist_t *power_ignore = NULL;
+static ignorelist_t *power_ignore;
 
 static int mic_init(void) {
   U32 ret;
index 2b5e687..efcf6be 100644 (file)
@@ -152,7 +152,7 @@ struct mb_data_group_s /* {{{ */
 /*
  * Global variables
  */
-static mb_data_t *data_definitions = NULL;
+static mb_data_t *data_definitions;
 
 /*
  * Functions
index 3d89f40..48c34ed 100644 (file)
@@ -88,8 +88,8 @@ struct mqtt_client_conf {
 };
 typedef struct mqtt_client_conf mqtt_client_conf_t;
 
-static mqtt_client_conf_t **subscribers = NULL;
-static size_t subscribers_num = 0;
+static mqtt_client_conf_t **subscribers;
+static size_t subscribers_num;
 
 /*
  * Functions
index 67fbe55..0458547 100644 (file)
@@ -92,12 +92,12 @@ struct qos_stats {
 };
 
 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 char **iflist = NULL;
-static size_t iflist_len = 0;
+static char **iflist;
+static size_t iflist_len;
 
 static const char *config_keys[] = {"Interface", "VerboseInterface",
                                     "QDisc",     "Class",
index ab5ff29..84ba00b 100644 (file)
@@ -261,30 +261,30 @@ typedef struct receive_list_entry_s receive_list_entry_t;
 /*
  * Private variables
  */
-static int network_config_ttl = 0;
+static int network_config_ttl;
 /* Ethernet - (IPv6 + UDP) = 1500 - (40 + 8) = 1452 */
 static size_t network_config_packet_size = 1452;
 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 uint64_t receive_list_length;
 
-static sockent_t *listen_sockets = NULL;
-static struct pollfd *listen_sockets_pollfd = NULL;
-static size_t listen_sockets_num = 0;
+static sockent_t *listen_sockets;
+static struct pollfd *listen_sockets_pollfd;
+static size_t listen_sockets_num;
 
 /* The receive and dispatch threads will run as long as `listen_loop' is set to
  * zero. */
-static int listen_loop = 0;
-static int receive_thread_running = 0;
+static int listen_loop;
+static int receive_thread_running;
 static pthread_t receive_thread_id;
-static int dispatch_thread_running = 0;
+static int dispatch_thread_running;
 static pthread_t dispatch_thread_id;
 
 /* Buffer in which to-be-sent network packets are constructed. */
@@ -301,14 +301,14 @@ static pthread_mutex_t send_buffer_lock = PTHREAD_MUTEX_INITIALIZER;
  * example). Only if neither is true, the stats_lock is acquired. The counters
  * are always read without holding a lock in the hope that writing 8 bytes to
  * memory is an atomic operation. */
-static derive_t stats_octets_rx = 0;
-static derive_t stats_octets_tx = 0;
-static derive_t stats_packets_rx = 0;
-static derive_t stats_packets_tx = 0;
-static derive_t stats_values_dispatched = 0;
-static derive_t stats_values_not_dispatched = 0;
-static derive_t stats_values_sent = 0;
-static derive_t stats_values_not_sent = 0;
+static derive_t stats_octets_rx;
+static derive_t stats_octets_tx;
+static derive_t stats_packets_rx;
+static derive_t stats_packets_tx;
+static derive_t stats_values_dispatched;
+static derive_t stats_values_not_dispatched;
+static derive_t stats_values_sent;
+static derive_t stats_values_not_sent;
 static pthread_mutex_t stats_lock = PTHREAD_MUTEX_INITIALIZER;
 
 /*
@@ -1113,7 +1113,7 @@ static int parse_part_sign_sha256(sockent_t *se, /* {{{ */
 static int parse_part_sign_sha256(sockent_t *se, /* {{{ */
                                   void **ret_buffer, size_t *ret_buffer_size,
                                   int flags) {
-  static int warning_has_been_printed = 0;
+  static int warning_has_been_printed;
 
   char *buffer;
   size_t buffer_size;
@@ -1268,7 +1268,7 @@ static int parse_part_encr_aes256(sockent_t *se, /* {{{ */
 static int parse_part_encr_aes256(sockent_t *se, /* {{{ */
                                   void **ret_buffer, size_t *ret_buffer_size,
                                   int flags) {
-  static int warning_has_been_printed = 0;
+  static int warning_has_been_printed;
 
   char *buffer;
   size_t buffer_size;
index e031cb7..e1987f1 100644 (file)
--- a/src/nfs.c
+++ b/src/nfs.c
@@ -409,7 +409,7 @@ static int nfs_submit_fields_safe(int nfs_version, const char *instance,
 
 static int nfs_submit_nfs4_server(const char *instance, char **fields,
                                   size_t fields_num) {
-  static int suppress_warning = 0;
+  static int suppress_warning;
   size_t proc4x_names_num;
 
   switch (fields_num) {
@@ -451,7 +451,7 @@ static int nfs_submit_nfs4_client(const char *instance, char **fields,
                                   size_t fields_num) {
   size_t proc40_names_num, proc4x_names_num;
 
-  static int suppress_warning = 0;
+  static int suppress_warning;
 
   switch (fields_num) {
   case 34:
index 88118b9..e5ca89c 100644 (file)
 
 #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 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 nginx_buffer[16384];
-static size_t nginx_buffer_len = 0;
+static size_t nginx_buffer_len;
 static char nginx_curl_error[CURL_ERROR_SIZE];
 
 static const char *config_keys[] = {
index 52cc838..6b32ad9 100644 (file)
@@ -38,19 +38,19 @@ static const char *config_keys[] = {"SMTPServer",   "SMTPPort", "SMTPUser",
 static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
 
 static char **recipients;
-static int recipients_len = 0;
+static int recipients_len;
 
 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 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"
index 8976866..baa1988 100644 (file)
@@ -66,7 +66,7 @@ static bool include_unit_id;
 #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];
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
index 58c7d79..1d1e94b 100644 (file)
--- a/src/nut.c
+++ b/src/nut.c
@@ -53,11 +53,11 @@ struct nut_ups_s {
 static const char *config_keys[] = {"UPS", "FORCESSL", "VERIFYPEER", "CAPATH",
                                     "CONNECTTIMEOUT"};
 static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
-static int force_ssl = 0;   // Initialized to default of 0 (false)
-static int verify_peer = 0; // Initialized to default of 0 (false)
+static int force_ssl;   // Initialized to default of 0 (false)
+static int verify_peer; // 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);
 
index eb64077..df05288 100644 (file)
@@ -41,8 +41,8 @@ static const char *config_keys[] = {"Host", "Port", "CollectLinks",
                                     "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
index 37112ad..49c6aa3 100644 (file)
@@ -86,8 +86,8 @@ static ow_family_features_t ow_family_features[] = {
      /* features_num = */ 1}};
 static int ow_family_features_num = STATIC_ARRAY_SIZE(ow_family_features);
 
-static char *device_g = NULL;
-static cdtime_t ow_interval = 0;
+static char *device_g;
+static cdtime_t ow_interval;
 static bool direct_access;
 
 static const char *config_keys[] = {"Device", "IgnoreSelected", "Sensor",
@@ -109,7 +109,7 @@ typedef struct direct_access_element_s {
   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;
 
 /* ===================================================================================
  */
index bf6aef5..c76bce2 100644 (file)
@@ -75,10 +75,10 @@ typedef struct o_database_s o_database_t;
 /*
  * Global variables
  */
-static udb_query_t **queries = NULL;
-static size_t queries_num = 0;
-static o_database_t **databases = NULL;
-static size_t databases_num = 0;
+static udb_query_t **queries;
+static size_t queries_num;
+static o_database_t **databases;
+static size_t databases_num;
 
 OCIEnv *oci_env = NULL;
 OCIError *oci_error = NULL;
index 6683b4c..4c6387d 100644 (file)
@@ -187,13 +187,13 @@ static bool register_legacy_flush = true;
 
 /* 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;
-static char **perl_argv = NULL;
+static int perl_argc;
+static char **perl_argv;
 
 static char base_name[DATA_MAX_NAME_LEN] = "";
 
index e82ac0e..66b9cd1 100644 (file)
@@ -99,12 +99,12 @@ typedef struct pinba_statnode_s pinba_statnode_t;
  * Module global variables
  */
 /* {{{ */
-static pinba_statnode_t *stat_nodes = NULL;
-static unsigned int stat_nodes_num = 0;
+static pinba_statnode_t *stat_nodes;
+static unsigned int stat_nodes_num;
 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;
index 565ae99..ffb1691 100644 (file)
@@ -69,14 +69,14 @@ typedef struct hostlist_s hostlist_t;
 /*
  * Private variables
  */
-static hostlist_t *hostlist_head = NULL;
+static hostlist_t *hostlist_head;
 
 static int ping_af = PING_DEF_AF;
-static char *ping_source = NULL;
+static char *ping_source;
 #ifdef HAVE_OPING_1_3
-static char *ping_device = NULL;
+static char *ping_device;
 #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;
@@ -84,8 +84,8 @@ static int ping_max_missed = -1;
 
 static pthread_mutex_t ping_lock = PTHREAD_MUTEX_INITIALIZER;
 static pthread_cond_t ping_cond = PTHREAD_COND_INITIALIZER;
-static int ping_thread_loop = 0;
-static int ping_thread_error = 0;
+static int ping_thread_loop;
+static int ping_thread_error;
 static pthread_t ping_thread_id;
 
 static const char *config_keys[] = {"Host",    "SourceAddress", "AddressFamily",
index f626b57..7c140e0 100644 (file)
@@ -155,14 +155,14 @@ static const char *const 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 size_t databases_num = 0;
+static c_psql_database_t **databases;
+static size_t databases_num;
 
-static udb_query_t **queries = NULL;
-static size_t queries_num = 0;
+static udb_query_t **queries;
+static size_t queries_num;
 
-static c_psql_writer_t *writers = NULL;
-static size_t writers_num = 0;
+static c_psql_writer_t *writers;
+static size_t writers_num;
 
 static int c_psql_begin(c_psql_database_t *db) {
   PGresult *r = PQexec(db->conn, "BEGIN");
@@ -1237,7 +1237,7 @@ static int c_psql_config_database(oconfig_item_t *ci) {
 } /* c_psql_config_database */
 
 static int c_psql_config(oconfig_item_t *ci) {
-  static int have_def_config = 0;
+  static int have_def_config;
 
   if (0 == have_def_config) {
     oconfig_item_t *c;
index 729a15b..eb3ec53 100644 (file)
@@ -304,10 +304,10 @@ static statname_lookup_t 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"
-static char *local_sockpath = NULL;
+static char *local_sockpath;
 
 /* TODO: Do this before 4.4:
  * - Update the collectd.conf(5) manpage.
index 2a4ce1f..cfc5790 100644 (file)
@@ -293,7 +293,7 @@ typedef struct procstat {
   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;
@@ -334,7 +334,7 @@ int getargs(void *processBuffer, int bufferLen, char *argsBuffer, int argsLen);
 #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
index a50539e..59eb49a 100644 (file)
@@ -45,7 +45,7 @@ static const char *config_keys[] = {
 };
 static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
 
-static ignorelist_t *values_list = NULL;
+static ignorelist_t *values_list;
 
 /*
  * Functions
index c6e8930..4ba7e0d 100644 (file)
@@ -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 *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)
index 969a4db..64db698 100644 (file)
@@ -257,8 +257,8 @@ static cpy_callback_t *cpy_init_callbacks;
 static cpy_callback_t *cpy_shutdown_callbacks;
 
 /* Make sure to hold the GIL while modifying these. */
-static int cpy_shutdown_triggered = 0;
-static int cpy_num_callbacks = 0;
+static int cpy_shutdown_triggered;
+static int cpy_num_callbacks;
 
 static void cpy_destroy_user_data(void *data) {
   cpy_callback_t *c = data;
index 12c8dde..301df44 100644 (file)
@@ -52,9 +52,8 @@ typedef struct {
 
 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)
@@ -203,7 +202,7 @@ static int PluginData_init(PyObject *s, PyObject *args, PyObject *kwds) {
 
 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(")");
@@ -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 *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)
@@ -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 *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)
index 7c704ab..2d33e2d 100644 (file)
@@ -76,7 +76,7 @@ struct redis_node_s {
   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) /* {{{ */
 {
index c09e048..8b742bb 100644 (file)
@@ -37,8 +37,8 @@
 /*
  * 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 = {
index e3ad07e..5c87a43 100644 (file)
@@ -66,8 +66,8 @@ 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. */
-static char *datadir = NULL;
-static double write_rate = 0.0;
+static char *datadir;
+static double write_rate;
 static rrdcreate_config_t rrdcreate_config = {
     /* stepsize = */ 0,
     /* heartbeat = */ 0,
@@ -84,17 +84,17 @@ static rrdcreate_config_t rrdcreate_config = {
 
 /* XXX: If you need to lock both, cache_lock and queue_lock, at the same time,
  * ALWAYS lock `cache_lock' first! */
-static cdtime_t cache_timeout = 0;
-static cdtime_t cache_flush_timeout = 0;
-static cdtime_t random_timeout = 0;
+static cdtime_t cache_timeout;
+static cdtime_t cache_flush_timeout;
+static cdtime_t random_timeout;
 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 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;
@@ -104,7 +104,7 @@ static pthread_cond_t queue_cond = PTHREAD_COND_INITIALIZER;
 static pthread_mutex_t librrd_lock = PTHREAD_MUTEX_INITIALIZER;
 #endif
 
-static int do_shutdown = 0;
+static int do_shutdown;
 
 #if HAVE_THREADSAFE_LIBRRD
 static int srrd_update(char *filename, char *template, int argc,
@@ -1010,7 +1010,7 @@ static int rrd_shutdown(void) {
 } /* int rrd_shutdown */
 
 static int rrd_init(void) {
-  static int init_once = 0;
+  static int init_once;
 
   if (init_once != 0)
     return 0;
index ddd09d9..41cccf1 100644 (file)
@@ -157,7 +157,7 @@ typedef struct featurelist {
   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) */
 
@@ -166,7 +166,7 @@ static bool use_labels;
        "as bug."
 #endif
 
-static featurelist_t *first_feature = NULL;
+static featurelist_t *first_feature;
 static ignorelist_t *sensor_list;
 
 #if SENSORS_API_VERSION < 0x400
@@ -251,7 +251,7 @@ static void sensors_free_features(void) {
 }
 
 static int sensors_load_conf(void) {
-  static int call_once = 0;
+  static int call_once;
 
   FILE *fh = NULL;
   featurelist_t *last_feature = NULL;
index 30680be..62cbb4f 100644 (file)
@@ -42,9 +42,9 @@ static const char *config_keys[] = {"Disk", "IgnoreSelected", "IgnoreSleepMode",
 
 static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
 
-static ignorelist_t *ignorelist = NULL;
-static int ignore_sleep_mode = 0;
-static int use_serial = 0;
+static ignorelist_t *ignorelist;
+static int ignore_sleep_mode;
+static int use_serial;
 
 static int smart_config(const char *key, const char *value) {
   if (ignorelist == NULL)
index 800c050..433f5f8 100644 (file)
@@ -115,7 +115,7 @@ typedef struct csnmp_table_values_s csnmp_table_values_t;
 /*
  * Private variables
  */
-static data_definition_t *data_head = NULL;
+static data_definition_t *data_head;
 
 /*
  * Prototypes
@@ -219,7 +219,7 @@ static void csnmp_host_definition_destroy(void *arg) /* {{{ */
  *      +-> csnmp_config_add_host_security_level
  */
 static void call_snmp_init_once(void) {
-  static int have_init = 0;
+  static int have_init;
 
   if (have_init == 0)
     init_snmp(PACKAGE_NAME);
index 0675a76..48d9f86 100644 (file)
@@ -90,7 +90,7 @@ struct snmp_agent_ctx_s {
 };
 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) &&                              \
index c7b472f..28ee337 100644 (file)
@@ -61,22 +61,22 @@ struct statsd_metric_s {
 };
 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 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 double *conf_timer_percentile = NULL;
+static double *conf_timer_percentile;
 static size_t conf_timer_percentile_num;
 
 static bool conf_counter_sum;
index ede638a..db0b987 100644 (file)
@@ -93,7 +93,7 @@ static bool report_by_device;
 /* #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 */
 
index 90a97fb..beb8245 100644 (file)
@@ -38,7 +38,7 @@ static int log_level = LOG_DEBUG;
 #else
 static int log_level = LOG_INFO;
 #endif /* COLLECT_DEBUG */
-static int notif_severity = 0;
+static int notif_severity;
 
 static const char *config_keys[] = {
     "LogLevel", "NotifyLevel",
index fbba478..a6471d8 100644 (file)
@@ -59,8 +59,8 @@ struct ctail_config_match_s {
 };
 typedef struct ctail_config_match_s ctail_config_match_t;
 
-static cu_tail_match_t **tail_match_list = NULL;
-static size_t tail_match_list_num = 0;
+static cu_tail_match_t **tail_match_list;
+static size_t tail_match_list_num;
 static cdtime_t tail_match_list_intervals[255];
 
 static int ctail_config_add_match_dstype(ctail_config_match_t *cm,
@@ -134,8 +134,7 @@ static int ctail_config_add_match_dstype(ctail_config_match_t *cm,
   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};
@@ -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,
-        (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.");
@@ -234,7 +233,7 @@ static int ctail_config_add_file(oconfig_item_t *ci) {
     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)
index ff96705..be7cd40 100644 (file)
@@ -57,7 +57,7 @@ struct instance_definition_s {
 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) {
index f59b7ea..26bd969 100644 (file)
@@ -36,7 +36,7 @@
 #define MAX_NUMTAPE 256
 extern kstat_ctl_t *kc;
 static kstat_t *ksp[MAX_NUMTAPE];
-static int numtape = 0;
+static int numtape;
 
 static int tape_init(void) {
   kstat_t *ksp_chain;
index 50d8efb..90dedce 100644 (file)
@@ -205,7 +205,7 @@ static const char *tcp_state[] = {"CLOSED",    "LISTEN",      "SYN_SENT",
                                   "FIN_WAIT2", "TIME_WAIT"};
 
 static kvm_t *kvmd;
-static u_long inpcbtable_off = 0;
+static u_long inpcbtable_off;
 struct inpcbtable *inpcbtable_ptr = NULL;
 
 #define TCP_STATE_LISTEN 1
@@ -261,9 +261,9 @@ static const char *config_keys[] = {"ListeningPorts", "LocalPort", "RemotePort",
                                     "AllPortsSummary"};
 static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
 
-static int port_collect_listening = 0;
-static int port_collect_total = 0;
-static port_entry_t *port_list_head = NULL;
+static int port_collect_listening;
+static int port_collect_total;
+static port_entry_t *port_list_head;
 static uint32_t count_total[TCP_STATE_MAX + 1];
 
 #if KERNEL_LINUX
@@ -271,7 +271,7 @@ static uint32_t count_total[TCP_STATE_MAX + 1];
 /* This depends on linux inet_diag_req because if this structure is missing,
  * sequence_number is useless and we get a compilation warning.
  */
-static uint32_t sequence_number = 0;
+static uint32_t sequence_number;
 #endif
 
 static enum { SRC_DUNNO, SRC_NETLINK, SRC_PROC } linux_source = SRC_DUNNO;
index ae9200c..6d0cdbb 100644 (file)
@@ -46,14 +46,14 @@ typedef struct vserver_list_s {
   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 */
-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"};
index b803681..b5fa4c1 100644 (file)
--- a/src/ted.c
+++ b/src/ted.c
@@ -53,8 +53,8 @@
 
 #define DEFAULT_DEVICE "/dev/ttyUSB0"
 
-static char *conf_device = NULL;
-static int conf_retries = 0;
+static char *conf_device;
+static int conf_retries;
 
 static int fd = -1;
 
index 41e2e81..5cf6955 100644 (file)
@@ -29,8 +29,8 @@
 
 #include <inttypes.h>
 
-static int fail_count__ = 0;
-static int check_count__ = 0;
+static int fail_count__;
+static int check_count__;
 
 #ifndef DBL_PRECISION
 #define DBL_PRECISION 1e-12
index 1534f51..aca0a4e 100644 (file)
 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) {
index be80a3a..522271c 100644 (file)
@@ -55,12 +55,12 @@ static const char *config_keys[] = {"SocketFile", "SocketGroup", "SocketPerms",
                                     "DeleteSocket"};
 static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
 
-static int loop = 0;
+static int loop;
 
 /* 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;
 
@@ -361,7 +361,7 @@ static int us_config(const char *key, const char *val) {
 } /* int us_config */
 
 static int us_init(void) {
-  static int have_init = 0;
+  static int have_init;
 
   int status;
 
index e7e04f7..7b20e13 100644 (file)
@@ -158,16 +158,16 @@ typedef int(printer)(const char *, ...);
  */
 
 #if HAVE_PCAP_H
-static pcap_t *pcap_obj = NULL;
+static pcap_t *pcap_obj;
 #endif
 
-static ip_list_t *IgnoreList = NULL;
+static ip_list_t *IgnoreList;
 
 #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;
+static int query_count_total;
 #ifdef __OpenBSD__
 static struct bpf_timeval last_ts;
 #else
@@ -267,7 +267,7 @@ static int rfc1035NameUnpack(const char *buf, size_t sz, off_t *off, char *name,
   off_t no = 0;
   unsigned char c;
   size_t len;
-  static int loop_detect = 0;
+  static int loop_detect;
   if (loop_detect > 2)
     return 4; /* compression loop */
   if (ns == 0)
index 57629a0..3b7236c 100644 (file)
@@ -191,7 +191,7 @@ struct ovs_db_s {
 };
 
 /* Global variables */
-static uint64_t ovs_uid = 0;
+static uint64_t ovs_uid;
 static pthread_mutex_t ovs_uid_mutex = PTHREAD_MUTEX_INITIALIZER;
 
 /* Post an event to event thread.
index ef12601..ce7838d 100644 (file)
@@ -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 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;
 
 /*
index 1cb9027..39b1fe6 100644 (file)
@@ -37,7 +37,7 @@
 #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"};
 
index 69a35a7..12008f8 100644 (file)
@@ -241,8 +241,8 @@ const char *domain_reasons[][DOMAIN_STATE_REASON_MAX_SIZE] = {
   } while (0)
 
 /* Connection. */
-static virConnectPtr conn = 0;
-static char *conn_string = NULL;
+static virConnectPtr conn;
+static char *conn_string;
 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 ignorelist_t *il_domains = NULL;
+static ignorelist_t *il_domains;
 /* 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. */
-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);
index 95cfbaf..c722975 100644 (file)
@@ -33,7 +33,7 @@
 static const char *config_keys[] = {"Verbose"};
 static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
 
-static int verbose_output = 0;
+static int verbose_output;
 /* #endif KERNEL_LINUX */
 
 #else
index f15bb3b..3c6d58c 100644 (file)
@@ -42,7 +42,7 @@
 #error "No applicable input method."
 #endif
 
-static int pagesize = 0;
+static int pagesize;
 
 static int vserver_init(void) {
   /* XXX Should we check for getpagesize () in configure?
index 99885a6..3b4a574 100644 (file)
@@ -119,8 +119,8 @@ struct sensu_host {
   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,
index a422f37..42f5d65 100644 (file)
@@ -94,8 +94,8 @@ struct wt_callback {
   cdtime_t next_random_ttl;
 };
 
-static cdtime_t resolve_interval = 0;
-static cdtime_t resolve_jitter = 0;
+static cdtime_t resolve_interval;
+static cdtime_t resolve_jitter;
 
 /*
  * Functions
index 1de01d0..a99bbc0 100644 (file)
@@ -37,8 +37,8 @@
 #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);