Don't initialize static numeric variables to 0
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Mon, 14 May 2018 12:10:34 +0000 (14:10 +0200)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Mon, 14 May 2018 12:12:58 +0000 (14:12 +0200)
62 files changed:
src/amqp.c
src/apcups.c
src/ascent.c
src/barometer.c
src/bind.c
src/ceph.c
src/collectd-nagios.c
src/collectdmon.c
src/conntrack.c
src/cpu.c
src/cpufreq.c
src/csv.c
src/daemon/collectd.c
src/daemon/filter_chain.c
src/daemon/plugin.c
src/daemon/utils_avltree_test.c
src/dbi.c
src/disk.c
src/dns.c
src/email.c
src/ethstat.c
src/filecount.c
src/gmond.c
src/interface.c
src/iptables.c
src/java.c
src/libcollectdclient/network_buffer.c
src/libcollectdclient/network_parse.c
src/logfile.c
src/madwifi.c
src/mic.c
src/mqtt.c
src/netlink.c
src/network.c
src/nfs.c
src/nginx.c
src/notify_email.c
src/nut.c
src/onewire.c
src/oracle.c
src/perl.c
src/pinba.c
src/ping.c
src/postgresql.c
src/python.c
src/rrdtool.c
src/sensors.c
src/smart.c
src/snmp.c
src/syslog.c
src/tail.c
src/tape.c
src/tcpconns.c
src/ted.c
src/testing.h
src/unixsock.c
src/utils_dns.c
src/utils_ovs.c
src/virt.c
src/vmem.c
src/vserver.c
src/write_tsdb.c

index 7a91ba1..281130b 100644 (file)
@@ -112,7 +112,7 @@ static const char *def_password = "guest";
 static const char *def_exchange = "amq.fanout";
 
 static pthread_t *subscriber_threads;
 static const char *def_exchange = "amq.fanout";
 
 static pthread_t *subscriber_threads;
-static size_t subscriber_threads_num = 0;
+static size_t subscriber_threads_num;
 static bool subscriber_threads_running = true;
 
 #define CONF(c, f) (((c)->f != NULL) ? (c)->f : def_##f)
 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 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;
 
   amqp_rpc_reply_t reply;
   int status;
index 4e84ebd..2931d2c 100644 (file)
@@ -78,8 +78,8 @@ static bool conf_persistent_conn = true;
 
 static int global_sockfd = -1;
 
 
 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;
 
 static int net_shutdown(int *fd) {
   uint16_t packet_size = 0;
index 09dd5de..2235865 100644 (file)
@@ -98,8 +98,8 @@ static char *timeout;
 static CURL *curl;
 
 static char *ascent_buffer;
 static CURL *curl;
 
 static char *ascent_buffer;
-static size_t ascent_buffer_size = 0;
-static size_t ascent_buffer_fill = 0;
+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[] = {
 static char ascent_curl_error[CURL_ERROR_SIZE];
 
 static const char *config_keys[] = {
index 17c2a1a..66ab20c 100644 (file)
@@ -180,11 +180,11 @@ static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
 static char *config_device;       /**< 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 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 */
 
 
 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 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) */
 
 // BMP085 configuration
 static unsigned bmp085_oversampling; /**< BMP085 oversampling (0-3) */
index 2d10aba..370ebc5 100644 (file)
@@ -111,18 +111,18 @@ 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_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;
 static int global_memory_stats = 1;
 static int timeout = -1;
 
 static cb_view_t *views;
-static size_t views_num = 0;
+static size_t views_num;
 
 static CURL *curl;
 
 static char *bind_buffer;
 
 static CURL *curl;
 
 static char *bind_buffer;
-static size_t bind_buffer_size = 0;
-static size_t bind_buffer_fill = 0;
+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. */
 static char bind_curl_error[CURL_ERROR_SIZE];
 
 /* Translation table for the `nsstats' values. */
index e2c98ed..2622dc7 100644 (file)
@@ -148,7 +148,7 @@ enum perfcounter_type_d {
 };
 
 /** Give user option to use default (long run = since daemon started) avg */
 };
 
 /** Give user option to use default (long run = since daemon started) avg */
-static int long_run_latency_avg = 0;
+static int long_run_latency_avg;
 
 /**
  * Give user option to use default type for special cases -
 
 /**
  * Give user option to use default type for special cases -
@@ -164,7 +164,7 @@ static int convert_special_metrics = 1;
 static struct ceph_daemon **g_daemons;
 
 /** Number of elements in g_daemons */
 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.
 
 /**
  * A set of data that we build up in memory while parsing the JSON.
index 68ed437..54be36a 100644 (file)
@@ -104,7 +104,7 @@ static int consolitation_g = CON_NONE;
 static bool nan_is_error_g;
 
 static char **match_ds_g;
 static bool nan_is_error_g;
 
 static char **match_ds_g;
-static size_t match_ds_num_g = 0;
+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
 
 /* `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 6c19889..089e52b 100644 (file)
 #define WCOREDUMP(s) 0
 #endif /* ! WCOREDUMP */
 
 #define WCOREDUMP(s) 0
 #endif /* ! WCOREDUMP */
 
-static int loop = 0;
-static int restart = 0;
+static int loop;
+static int restart;
 
 static const char *pidfile;
 
 static const char *pidfile;
-static pid_t collectd_pid = 0;
+static pid_t collectd_pid;
 
 __attribute__((noreturn)) static void exit_usage(const char *name) {
   printf("Usage: %s <options> [-- <collectd options>]\n"
 
 __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 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;
 
   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
 */
 
     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)
 
 static int conntrack_config(const char *key, const char *value) {
   if (strcmp(key, "OldFiles") == 0)
index 7478a4a..2a69712 100644 (file)
--- a/src/cpu.c
+++ b/src/cpu.c
@@ -188,11 +188,11 @@ struct cpu_state_s {
 typedef struct cpu_state_s cpu_state_t;
 
 static cpu_state_t *cpu_states;
 typedef struct cpu_state_s cpu_state_t;
 
 static cpu_state_t *cpu_states;
-static size_t cpu_states_num = 0; /* #cpu_states allocated */
+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(). */
 
 /* 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;
 
 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"
 
 #include "common.h"
 #include "plugin.h"
 
-static int num_cpu = 0;
+static int num_cpu;
 
 static int cpufreq_init(void) {
   int status;
 
 static int cpufreq_init(void) {
   int status;
index 34fc223..be59ede 100644 (file)
--- a/src/csv.c
+++ b/src/csv.c
@@ -34,8 +34,8 @@ static const char *config_keys[] = {"DataDir", "StoreRates"};
 static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
 
 static char *datadir;
 static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
 
 static char *datadir;
-static int store_rates = 0;
-static int use_stdio = 0;
+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) {
 
 static int value_list_to_string(char *buffer, int buffer_len,
                                 const data_set_t *ds, const value_list_t *vl) {
index 3b959c7..d15bb33 100644 (file)
@@ -51,7 +51,7 @@
 #define COLLECTD_LOCALE "C"
 #endif
 
 #define COLLECTD_LOCALE "C"
 #endif
 
-static int loop = 0;
+static int loop;
 
 static void *do_flush(void __attribute__((unused)) * arg) {
   INFO("Flushing all data.");
 
 static void *do_flush(void __attribute__((unused)) * arg) {
   INFO("Flushing all data.");
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 fc_init_once(void) /* {{{ */
 {
-  static int done = 0;
+  static int done;
   target_proc_t tproc = {0};
 
   if (done != 0)
   target_proc_t tproc = {0};
 
   if (done != 0)
index 5374d8d..427a813 100644 (file)
@@ -120,25 +120,25 @@ 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;
 static pthread_mutex_t read_lock = PTHREAD_MUTEX_INITIALIZER;
 static pthread_cond_t read_cond = PTHREAD_COND_INITIALIZER;
 static pthread_t *read_threads;
-static size_t read_threads_num = 0;
+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 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;
 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;
-static size_t write_threads_num = 0;
+static size_t write_threads_num;
 
 static pthread_key_t plugin_ctx_key;
 static bool plugin_ctx_key_initialized;
 
 
 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;
 
 /*
 static bool record_statistics;
 
 /*
@@ -2025,7 +2025,7 @@ static double get_drop_probability(void) /* {{{ */
 
 static bool check_drop_value(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;
   static pthread_mutex_t last_message_lock = PTHREAD_MUTEX_INITIALIZER;
 
   double p;
index bb30f9d..3171246 100644 (file)
  *   Florian octo Forster <octo at collectd.org>
  */
 
  *   Florian octo Forster <octo at collectd.org>
  */
 
-#include "common.h" /* STATIC_ARRAY_SIZE */
 #include "collectd.h"
 #include "collectd.h"
+#include "common.h" /* STATIC_ARRAY_SIZE */
 
 #include "testing.h"
 #include "utils_avltree.h"
 
 
 #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;                                                   \
 #define RESET_COUNTS()                                                         \
   do {                                                                         \
     compare_total_count = 0;                                                   \
index dcc32e6..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
  * 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;
 #endif
 static udb_query_t **queries;
-static size_t queries_num = 0;
+static size_t queries_num;
 static cdbi_database_t **databases;
 static cdbi_database_t **databases;
-static size_t databases_num = 0;
+static size_t databases_num;
 
 static int cdbi_read_database(user_data_t *ud);
 
 
 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 cdbi_init(void) /* {{{ */
 {
-  static int did_init = 0;
+  static int did_init;
   int status;
 
   if (did_init != 0)
   int status;
 
   if (did_init != 0)
index 7b5c024..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];
 #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)
 /* #endif HAVE_LIBKSTAT */
 
 #elif defined(HAVE_LIBSTATGRAB)
index ef627eb..bd6820f 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
@@ -66,7 +66,7 @@ static counter_list_t *opcode_list;
 static counter_list_t *rcode_list;
 
 static pthread_t listen_thread;
 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;
 /* 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 4f49cfb..376dd6a 100644 (file)
@@ -117,7 +117,7 @@ static int sock_perms = S_IRWXU | S_IRWXG;
 static int max_conns = MAX_CONNS;
 
 /* state of the plugin */
 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;
 
 /* thread managing "client" connections */
 static pthread_t connector = (pthread_t)0;
index 371020c..0d4c7e1 100644 (file)
@@ -49,7 +49,7 @@ struct value_map_s {
 typedef struct value_map_s value_map_t;
 
 static char **interfaces;
 typedef struct value_map_s value_map_t;
 
 static char **interfaces;
-static size_t interfaces_num = 0;
+static size_t interfaces_num;
 
 static c_avl_tree_t *value_map;
 
 
 static c_avl_tree_t *value_map;
 
index 26c7da3..ef1a138 100644 (file)
@@ -61,7 +61,7 @@ struct fc_directory_conf_s {
 typedef struct fc_directory_conf_s fc_directory_conf_t;
 
 static fc_directory_conf_t **directories;
 typedef struct fc_directory_conf_s fc_directory_conf_t;
 
 static fc_directory_conf_t **directories;
-static size_t directories_num = 0;
+static size_t directories_num;
 
 static void fc_free_dir(fc_directory_conf_t *dir) {
   sfree(dir->path);
 
 static void fc_free_dir(fc_directory_conf_t *dir) {
   sfree(dir->path);
index 6ed4115..ca65419 100644 (file)
@@ -89,14 +89,14 @@ static char *mc_receive_group;
 static char *mc_receive_port;
 
 static struct pollfd *mc_receive_sockets;
 static char *mc_receive_port;
 
 static struct pollfd *mc_receive_sockets;
-static size_t mc_receive_sockets_num = 0;
+static size_t mc_receive_sockets_num;
 
 static socket_entry_t *mc_send_sockets;
 
 static socket_entry_t *mc_send_sockets;
-static size_t mc_send_sockets_num = 0;
+static size_t mc_send_sockets_num;
 static pthread_mutex_t mc_send_sockets_lock = PTHREAD_MUTEX_INITIALIZER;
 
 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[] =
 static pthread_t mc_receive_thread_id;
 
 static metric_map_t metric_map_default[] =
@@ -123,7 +123,7 @@ static metric_map_t metric_map_default[] =
 static size_t metric_map_len_default = STATIC_ARRAY_SIZE(metric_map_default);
 
 static metric_map_t *metric_map;
 static size_t metric_map_len_default = STATIC_ARRAY_SIZE(metric_map_default);
 
 static metric_map_t *metric_map;
-static size_t metric_map_len = 0;
+static size_t metric_map_len;
 
 static c_avl_tree_t *staging_tree;
 static pthread_mutex_t staging_lock = PTHREAD_MUTEX_INITIALIZER;
 
 static c_avl_tree_t *staging_tree;
 static pthread_mutex_t staging_lock = PTHREAD_MUTEX_INITIALIZER;
index 4060965..86110b0 100644 (file)
@@ -97,7 +97,7 @@ static bool report_inactive = true;
 #define MAX_NUMIF 256
 extern kstat_ctl_t *kc;
 static kstat_t *ksp[MAX_NUMIF];
 #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 */
 
 static bool unique_name;
 #endif /* HAVE_LIBKSTAT */
 
index c1f42d7..8fad588 100644 (file)
@@ -87,7 +87,7 @@ typedef struct {
 } ip_chain_t;
 
 static ip_chain_t **chain_list;
 } ip_chain_t;
 
 static ip_chain_t **chain_list;
-static int chain_num = 0;
+static int chain_num;
 
 static int iptables_config(const char *key, const char *value) {
   /* int ip_value; */
 
 static int iptables_config(const char *key, const char *value) {
   /* int ip_value; */
index 56b48df..449e816 100644 (file)
@@ -82,7 +82,7 @@ static pthread_key_t jvm_env_key;
 
 /* Configuration options for the JVM. */
 static char **jvm_argv;
 
 /* Configuration options for the JVM. */
 static char **jvm_argv;
-static size_t jvm_argc = 0;
+static size_t jvm_argc;
 
 /* List of class names to load */
 static java_plugin_class_t *java_classes_list;
 
 /* List of class names to load */
 static java_plugin_class_t *java_classes_list;
@@ -90,7 +90,7 @@ static size_t java_classes_list_len;
 
 /* List of config, init, and shutdown callbacks. */
 static cjni_callback_info_t *java_callbacks;
 
 /* List of config, init, and shutdown callbacks. */
 static cjni_callback_info_t *java_callbacks;
-static size_t java_callbacks_num = 0;
+static size_t java_callbacks_num;
 static pthread_mutex_t java_callbacks_lock = PTHREAD_MUTEX_INITIALIZER;
 
 static oconfig_item_t *config_block;
 static pthread_mutex_t java_callbacks_lock = PTHREAD_MUTEX_INITIALIZER;
 
 static oconfig_item_t *config_block;
index 373dd2b..5a1ee8d 100644 (file)
@@ -156,7 +156,7 @@ static bool have_gcrypt(void) /* {{{ */
 #ifndef HAVE_HTONLL
 static uint64_t htonll(uint64_t val) /* {{{ */
 {
 #ifndef HAVE_HTONLL
 static uint64_t htonll(uint64_t val) /* {{{ */
 {
-  static int config = 0;
+  static int config;
 
   uint32_t hi;
   uint32_t lo;
 
   uint32_t hi;
   uint32_t lo;
@@ -186,7 +186,7 @@ static uint64_t htonll(uint64_t val) /* {{{ */
 
 static double htond(double val) /* {{{ */
 {
 
 static double htond(double val) /* {{{ */
 {
-  static int config = 0;
+  static int config;
 
   union {
     uint8_t byte[8];
 
   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 double ntohd(double val) /* {{{ */
 {
-  static int config = 0;
+  static int config;
 
   union {
     uint8_t byte[8];
 
   union {
     uint8_t byte[8];
index 2b7fbae..fa56a1b 100644 (file)
@@ -41,7 +41,7 @@ static pthread_mutex_t file_lock = PTHREAD_MUTEX_INITIALIZER;
 
 static char *log_file;
 static int print_timestamp = 1;
 
 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"};
 
 static const char *config_keys[] = {"LogLevel", "File", "Timestamp",
                                     "PrintSeverity"};
index 9d1db55..60ac3c8 100644 (file)
@@ -350,7 +350,7 @@ static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
 static ignorelist_t *ignorelist;
 
 static int use_sysfs = 1;
 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);
 
 static inline int item_watched(int i) {
   assert(i >= 0);
index 0c4ace6..4f4a9ba 100644 (file)
--- a/src/mic.c
+++ b/src/mic.c
@@ -35,7 +35,7 @@
 #define MAX_CORES 256
 
 static MicDeviceOnSystem mics[MAX_MICS];
 #define MAX_CORES 256
 
 static MicDeviceOnSystem mics[MAX_MICS];
-static U32 num_mics = 0;
+static U32 num_mics;
 static HANDLE mic_handle;
 
 static int const therm_ids[] = {
 static HANDLE mic_handle;
 
 static int const therm_ids[] = {
index 9e56827..48c34ed 100644 (file)
@@ -89,7 +89,7 @@ struct mqtt_client_conf {
 typedef struct mqtt_client_conf mqtt_client_conf_t;
 
 static mqtt_client_conf_t **subscribers;
 typedef struct mqtt_client_conf mqtt_client_conf_t;
 
 static mqtt_client_conf_t **subscribers;
-static size_t subscribers_num = 0;
+static size_t subscribers_num;
 
 /*
  * Functions
 
 /*
  * Functions
index e99e38b..0458547 100644 (file)
@@ -97,7 +97,7 @@ static ir_ignorelist_t *ir_ignorelist_head;
 static struct mnl_socket *nl;
 
 static char **iflist;
 static struct mnl_socket *nl;
 
 static char **iflist;
-static size_t iflist_len = 0;
+static size_t iflist_len;
 
 static const char *config_keys[] = {"Interface", "VerboseInterface",
                                     "QDisc",     "Class",
 
 static const char *config_keys[] = {"Interface", "VerboseInterface",
                                     "QDisc",     "Class",
index abed5b8..84ba00b 100644 (file)
@@ -261,7 +261,7 @@ typedef struct receive_list_entry_s receive_list_entry_t;
 /*
  * Private variables
  */
 /*
  * 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;
 /* Ethernet - (IPv6 + UDP) = 1500 - (40 + 8) = 1452 */
 static size_t network_config_packet_size = 1452;
 static bool network_config_forward;
@@ -273,18 +273,18 @@ 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 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;
 static struct pollfd *listen_sockets_pollfd;
 
 static sockent_t *listen_sockets;
 static struct pollfd *listen_sockets_pollfd;
-static size_t listen_sockets_num = 0;
+static size_t listen_sockets_num;
 
 /* The receive and dispatch threads will run as long as `listen_loop' is set to
  * zero. */
 
 /* 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 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. */
 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. */
  * 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;
 
 /*
 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 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;
 
   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 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;
 
   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 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) {
   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;
 
                                   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:
 
   switch (fields_num) {
   case 34:
index 23feb1c..e5ca89c 100644 (file)
@@ -44,7 +44,7 @@ static char *timeout;
 static CURL *curl;
 
 static char nginx_buffer[16384];
 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[] = {
 static char nginx_curl_error[CURL_ERROR_SIZE];
 
 static const char *config_keys[] = {
index eb9ec00..6b32ad9 100644 (file)
@@ -38,7 +38,7 @@ static const char *config_keys[] = {"SMTPServer",   "SMTPPort", "SMTPUser",
 static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
 
 static char **recipients;
 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_session_t session;
 static pthread_mutex_t session_lock = PTHREAD_MUTEX_INITIALIZER;
index a51c4c0..1d1e94b 100644 (file)
--- a/src/nut.c
+++ b/src/nut.c
@@ -53,8 +53,8 @@ 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 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;
 static int ssl_flags = UPSCLI_CONN_TRYSSL;
 static int connect_timeout = -1;
 static char *ca_path;
index b1d4cbe..49c6aa3 100644 (file)
@@ -87,7 +87,7 @@ static ow_family_features_t ow_family_features[] = {
 static int ow_family_features_num = STATIC_ARRAY_SIZE(ow_family_features);
 
 static char *device_g;
 static int ow_family_features_num = STATIC_ARRAY_SIZE(ow_family_features);
 
 static char *device_g;
-static cdtime_t ow_interval = 0;
+static cdtime_t ow_interval;
 static bool direct_access;
 
 static const char *config_keys[] = {"Device", "IgnoreSelected", "Sensor",
 static bool direct_access;
 
 static const char *config_keys[] = {"Device", "IgnoreSelected", "Sensor",
index 9c4b929..c76bce2 100644 (file)
@@ -76,9 +76,9 @@ typedef struct o_database_s o_database_t;
  * Global variables
  */
 static udb_query_t **queries;
  * Global variables
  */
 static udb_query_t **queries;
-static size_t queries_num = 0;
+static size_t queries_num;
 static o_database_t **databases;
 static o_database_t **databases;
-static size_t databases_num = 0;
+static size_t databases_num;
 
 OCIEnv *oci_env = NULL;
 OCIError *oci_error = NULL;
 
 OCIEnv *oci_env = NULL;
 OCIError *oci_error = NULL;
index d760b41..4c6387d 100644 (file)
@@ -192,7 +192,7 @@ static c_ithread_list_t *perl_threads;
 /* the key used to store each pthread's ithread */
 static pthread_key_t perl_thr_key;
 
 /* the key used to store each pthread's ithread */
 static pthread_key_t perl_thr_key;
 
-static int perl_argc = 0;
+static int perl_argc;
 static char **perl_argv;
 
 static char base_name[DATA_MAX_NAME_LEN] = "";
 static char **perl_argv;
 
 static char base_name[DATA_MAX_NAME_LEN] = "";
index a323b45..66b9cd1 100644 (file)
@@ -100,7 +100,7 @@ typedef struct pinba_statnode_s pinba_statnode_t;
  */
 /* {{{ */
 static pinba_statnode_t *stat_nodes;
  */
 /* {{{ */
 static pinba_statnode_t *stat_nodes;
-static unsigned int stat_nodes_num = 0;
+static unsigned int stat_nodes_num;
 static pthread_mutex_t stat_nodes_lock;
 
 static char *conf_node;
 static pthread_mutex_t stat_nodes_lock;
 
 static char *conf_node;
index f89c830..ffb1691 100644 (file)
@@ -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 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",
 static pthread_t ping_thread_id;
 
 static const char *config_keys[] = {"Host",    "SourceAddress", "AddressFamily",
index 9adba7d..7c140e0 100644 (file)
@@ -156,13 +156,13 @@ static const char *const def_queries[] = {
 static int def_queries_num = STATIC_ARRAY_SIZE(def_queries);
 
 static c_psql_database_t **databases;
 static int def_queries_num = STATIC_ARRAY_SIZE(def_queries);
 
 static c_psql_database_t **databases;
-static size_t databases_num = 0;
+static size_t databases_num;
 
 static udb_query_t **queries;
 
 static udb_query_t **queries;
-static size_t queries_num = 0;
+static size_t queries_num;
 
 static c_psql_writer_t *writers;
 
 static c_psql_writer_t *writers;
-static size_t writers_num = 0;
+static size_t writers_num;
 
 static int c_psql_begin(c_psql_database_t *db) {
   PGresult *r = PQexec(db->conn, "BEGIN");
 
 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) {
 } /* 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;
 
   if (0 == have_def_config) {
     oconfig_item_t *c;
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 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;
 
 static void cpy_destroy_user_data(void *data) {
   cpy_callback_t *c = data;
index c93e9fc..5c87a43 100644 (file)
@@ -67,7 +67,7 @@ static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
  * is zero a default, depending on the `interval' member of the value list is
  * being used. */
 static char *datadir;
  * is zero a default, depending on the `interval' member of the value list is
  * being used. */
 static char *datadir;
-static double write_rate = 0.0;
+static double write_rate;
 static rrdcreate_config_t rrdcreate_config = {
     /* stepsize = */ 0,
     /* heartbeat = */ 0,
 static rrdcreate_config_t rrdcreate_config = {
     /* stepsize = */ 0,
     /* heartbeat = */ 0,
@@ -84,9 +84,9 @@ 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! */
 
 /* 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;
 static pthread_mutex_t cache_lock = PTHREAD_MUTEX_INITIALIZER;
 static cdtime_t cache_flush_last;
 static c_avl_tree_t *cache;
 static pthread_mutex_t cache_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 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,
 
 #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) {
 } /* int rrd_shutdown */
 
 static int rrd_init(void) {
-  static int init_once = 0;
+  static int init_once;
 
   if (init_once != 0)
     return 0;
 
   if (init_once != 0)
     return 0;
index 47db4e3..41cccf1 100644 (file)
@@ -251,7 +251,7 @@ static void sensors_free_features(void) {
 }
 
 static int sensors_load_conf(void) {
 }
 
 static int sensors_load_conf(void) {
-  static int call_once = 0;
+  static int call_once;
 
   FILE *fh = NULL;
   featurelist_t *last_feature = NULL;
 
   FILE *fh = NULL;
   featurelist_t *last_feature = NULL;
index 9f84955..62cbb4f 100644 (file)
@@ -43,8 +43,8 @@ static const char *config_keys[] = {"Disk", "IgnoreSelected", "IgnoreSleepMode",
 static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
 
 static ignorelist_t *ignorelist;
 static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
 
 static ignorelist_t *ignorelist;
-static int ignore_sleep_mode = 0;
-static int use_serial = 0;
+static int ignore_sleep_mode;
+static int use_serial;
 
 static int smart_config(const char *key, const char *value) {
   if (ignorelist == NULL)
 
 static int smart_config(const char *key, const char *value) {
   if (ignorelist == NULL)
index b616f67..433f5f8 100644 (file)
@@ -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) {
  *      +-> 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);
 
   if (have_init == 0)
     init_snmp(PACKAGE_NAME);
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 */
 #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",
 
 static const char *config_keys[] = {
     "LogLevel", "NotifyLevel",
index 3d52380..a6471d8 100644 (file)
@@ -60,7 +60,7 @@ struct ctail_config_match_s {
 typedef struct ctail_config_match_s ctail_config_match_t;
 
 static cu_tail_match_t **tail_match_list;
 typedef struct ctail_config_match_s ctail_config_match_t;
 
 static cu_tail_match_t **tail_match_list;
-static size_t tail_match_list_num = 0;
+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,
 static cdtime_t tail_match_list_intervals[255];
 
 static int ctail_config_add_match_dstype(ctail_config_match_t *cm,
index f59b7ea..26bd969 100644 (file)
@@ -36,7 +36,7 @@
 #define MAX_NUMTAPE 256
 extern kstat_ctl_t *kc;
 static kstat_t *ksp[MAX_NUMTAPE];
 #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;
 
 static int tape_init(void) {
   kstat_t *ksp_chain;
index 07170d7..90dedce 100644 (file)
@@ -205,7 +205,7 @@ static const char *tcp_state[] = {"CLOSED",    "LISTEN",      "SYN_SENT",
                                   "FIN_WAIT2", "TIME_WAIT"};
 
 static kvm_t *kvmd;
                                   "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
 struct inpcbtable *inpcbtable_ptr = NULL;
 
 #define TCP_STATE_LISTEN 1
@@ -261,8 +261,8 @@ static const char *config_keys[] = {"ListeningPorts", "LocalPort", "RemotePort",
                                     "AllPortsSummary"};
 static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
 
                                     "AllPortsSummary"};
 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;
+static int port_collect_total;
 static port_entry_t *port_list_head;
 static uint32_t count_total[TCP_STATE_MAX + 1];
 
 static port_entry_t *port_list_head;
 static uint32_t count_total[TCP_STATE_MAX + 1];
 
@@ -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.
  */
 /* 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;
 #endif
 
 static enum { SRC_DUNNO, SRC_NETLINK, SRC_PROC } linux_source = SRC_DUNNO;
index 21d6357..b5fa4c1 100644 (file)
--- a/src/ted.c
+++ b/src/ted.c
@@ -54,7 +54,7 @@
 #define DEFAULT_DEVICE "/dev/ttyUSB0"
 
 static char *conf_device;
 #define DEFAULT_DEVICE "/dev/ttyUSB0"
 
 static char *conf_device;
-static int conf_retries = 0;
+static int conf_retries;
 
 static int fd = -1;
 
 
 static int fd = -1;
 
index 41e2e81..5cf6955 100644 (file)
@@ -29,8 +29,8 @@
 
 #include <inttypes.h>
 
 
 #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
 
 #ifndef DBL_PRECISION
 #define DBL_PRECISION 1e-12
index be2af75..522271c 100644 (file)
@@ -55,7 +55,7 @@ static const char *config_keys[] = {"SocketFile", "SocketGroup", "SocketPerms",
                                     "DeleteSocket"};
 static int config_keys_num = STATIC_ARRAY_SIZE(config_keys);
 
                                     "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;
 
 /* socket configuration */
 static int sock_fd = -1;
@@ -361,7 +361,7 @@ static int us_config(const char *key, const char *val) {
 } /* int us_config */
 
 static int us_init(void) {
 } /* int us_config */
 
 static int us_init(void) {
-  static int have_init = 0;
+  static int have_init;
 
   int status;
 
 
   int status;
 
index faa917f..7b20e13 100644 (file)
@@ -166,8 +166,8 @@ static ip_list_t *IgnoreList;
 #if HAVE_PCAP_H
 static void (*Callback)(const rfc1035_header_t *);
 
 #if HAVE_PCAP_H
 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
 #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;
   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)
   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 */
 };
 
 /* 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.
 static pthread_mutex_t ovs_uid_mutex = PTHREAD_MUTEX_INITIALIZER;
 
 /* Post an event to event thread.
index cdb7141..12008f8 100644 (file)
@@ -241,7 +241,7 @@ const char *domain_reasons[][DOMAIN_STATE_REASON_MAX_SIZE] = {
   } while (0)
 
 /* Connection. */
   } while (0)
 
 /* Connection. */
-static virConnectPtr conn = 0;
+static virConnectPtr conn;
 static char *conn_string;
 static c_complain_t conn_complain = C_COMPLAIN_INIT_STATIC;
 
 static char *conn_string;
 static c_complain_t conn_complain = C_COMPLAIN_INIT_STATIC;
 
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 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
 /* #endif KERNEL_LINUX */
 
 #else
index f15bb3b..3c6d58c 100644 (file)
@@ -42,7 +42,7 @@
 #error "No applicable input method."
 #endif
 
 #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?
 
 static int vserver_init(void) {
   /* XXX Should we check for getpagesize () in configure?
index a422f37..42f5d65 100644 (file)
@@ -94,8 +94,8 @@ struct wt_callback {
   cdtime_t next_random_ttl;
 };
 
   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
 
 /*
  * Functions