From 4e89060ceb1a14ec7f9abfe9caa6b0da7e76bd5c Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sun, 13 May 2018 19:05:33 +0200 Subject: [PATCH] Set static bools to true instead of 1 --- src/amqp.c | 2 +- src/apcups.c | 2 +- src/bind.c | 2 +- src/collectd-tg.c | 2 +- src/cpu.c | 6 +++--- src/daemon/plugin.c | 2 +- src/df.c | 2 +- src/fhcount.c | 2 +- src/hugepages.c | 6 +++--- src/interface.c | 2 +- src/libcollectdclient/network_buffer.c | 2 +- src/memory.c | 2 +- src/mic.c | 10 +++++----- src/nfs.c | 6 +++--- src/ntpd.c | 2 +- src/openvpn.c | 4 ++-- src/perl.c | 2 +- src/processes.c | 2 +- src/rrdcached.c | 4 ++-- src/swap.c | 4 ++-- src/turbostat.c | 2 +- 21 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/amqp.c b/src/amqp.c index 50711014..6d65bf83 100644 --- a/src/amqp.c +++ b/src/amqp.c @@ -113,7 +113,7 @@ static const char *def_exchange = "amq.fanout"; static pthread_t *subscriber_threads = NULL; static size_t subscriber_threads_num = 0; -static bool subscriber_threads_running = 1; +static bool subscriber_threads_running = true; #define CONF(c, f) (((c)->f != NULL) ? (c)->f : def_##f) diff --git a/src/apcups.c b/src/apcups.c index f16da90e..622e3a10 100644 --- a/src/apcups.c +++ b/src/apcups.c @@ -74,7 +74,7 @@ static char *conf_node = NULL; static char *conf_service = NULL; /* Defaults to false for backwards compatibility. */ static bool conf_report_seconds; -static bool conf_persistent_conn = 1; +static bool conf_persistent_conn = true; static int global_sockfd = -1; diff --git a/src/bind.c b/src/bind.c index 5937d267..7af42696 100644 --- a/src/bind.c +++ b/src/bind.c @@ -104,7 +104,7 @@ typedef struct list_info_ptr_s list_info_ptr_t; /* FIXME: Enabled by default for backwards compatibility. */ /* TODO: Remove time parsing code. */ -static bool config_parse_time = 1; +static bool config_parse_time = true; static char *url = NULL; static int global_opcodes = 1; diff --git a/src/collectd-tg.c b/src/collectd-tg.c index 85c5c1b6..6c0a8a5b 100644 --- a/src/collectd-tg.c +++ b/src/collectd-tg.c @@ -67,7 +67,7 @@ static c_heap_t *values_heap = NULL; static struct sigaction sigint_action; static struct sigaction sigterm_action; -static bool loop = 1; +static bool loop = true; __attribute__((noreturn)) static void exit_usage(int exit_status) /* {{{ */ { diff --git a/src/cpu.c b/src/cpu.c index a0e00d74..6db86293 100644 --- a/src/cpu.c +++ b/src/cpu.c @@ -194,12 +194,12 @@ static size_t cpu_states_num = 0; /* #cpu_states allocated */ * determine how many CPUs there were. Reset to 0 by cpu_reset(). */ static size_t global_cpu_num = 0; -static bool report_by_cpu = 1; -static bool report_by_state = 1; +static bool report_by_cpu = true; +static bool report_by_state = true; static bool report_percent; static bool report_num_cpu; static bool report_guest; -static bool subtract_guest = 1; +static bool subtract_guest = true; static const char *config_keys[] = {"ReportByCpu", "ReportByState", "ReportNumCpu", "ValuesPercentage", diff --git a/src/daemon/plugin.c b/src/daemon/plugin.c index 3dcd9fce..6752a6c1 100644 --- a/src/daemon/plugin.c +++ b/src/daemon/plugin.c @@ -126,7 +126,7 @@ 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 bool write_loop = 1; +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; diff --git a/src/df.c b/src/df.c index 7e4c715e..d8108e3f 100644 --- a/src/df.c +++ b/src/df.c @@ -57,7 +57,7 @@ static ignorelist_t *il_fstype = NULL; static bool by_device; static bool report_inodes; -static bool values_absolute = 1; +static bool values_absolute = true; static bool values_percentage; static int df_init(void) { diff --git a/src/fhcount.c b/src/fhcount.c index 9e74dabd..05506651 100644 --- a/src/fhcount.c +++ b/src/fhcount.c @@ -25,7 +25,7 @@ static const char *config_keys[] = {"ValuesAbsolute", "ValuesPercentage"}; static int config_keys_num = STATIC_ARRAY_SIZE(config_keys); -static bool values_absolute = 1; +static bool values_absolute = true; static bool values_percentage; static int fhcount_config(const char *key, const char *value) { diff --git a/src/hugepages.c b/src/hugepages.c index 23db25bf..adfc5bb4 100644 --- a/src/hugepages.c +++ b/src/hugepages.c @@ -35,10 +35,10 @@ static const char g_plugin_name[] = "hugepages"; -static bool g_flag_rpt_numa = 1; -static bool g_flag_rpt_mm = 1; +static bool g_flag_rpt_numa = true; +static bool g_flag_rpt_mm = true; -static bool g_values_pages = 1; +static bool g_values_pages = true; static bool g_values_bytes; static bool g_values_percent; diff --git a/src/interface.c b/src/interface.c index e0e08c39..39ca8803 100644 --- a/src/interface.c +++ b/src/interface.c @@ -88,7 +88,7 @@ static int config_keys_num = STATIC_ARRAY_SIZE(config_keys); static ignorelist_t *ignorelist = NULL; -static bool report_inactive = 1; +static bool report_inactive = true; #ifdef HAVE_LIBKSTAT #if HAVE_KSTAT_H diff --git a/src/libcollectdclient/network_buffer.c b/src/libcollectdclient/network_buffer.c index 07d3e767..2332e3ec 100644 --- a/src/libcollectdclient/network_buffer.c +++ b/src/libcollectdclient/network_buffer.c @@ -126,7 +126,7 @@ struct lcc_network_buffer_s { static bool have_gcrypt(void) /* {{{ */ { static bool result; - static bool need_init = 1; + static bool need_init = true; if (!need_init) return result; diff --git a/src/memory.c b/src/memory.c index ce9ef834..366ca1c8 100644 --- a/src/memory.c +++ b/src/memory.c @@ -94,7 +94,7 @@ static int pagesize; #error "No applicable input method." #endif -static bool values_absolute = 1; +static bool values_absolute = true; static bool values_percentage; static int memory_config(oconfig_item_t *ci) /* {{{ */ diff --git a/src/mic.c b/src/mic.c index 55bc684d..b65679e7 100644 --- a/src/mic.c +++ b/src/mic.c @@ -50,12 +50,12 @@ static const char *config_keys[] = { "ShowPower", "Power", "IgnoreSelectedPower"}; static int config_keys_num = STATIC_ARRAY_SIZE(config_keys); -static bool show_cpu = 1; -static bool show_cpu_cores = 1; -static bool show_memory = 1; -static bool show_temps = 1; +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 bool show_power = 1; +static bool show_power = true; static ignorelist_t *power_ignore = NULL; static int mic_init(void) { diff --git a/src/nfs.c b/src/nfs.c index 8d5b6309..e031cb70 100644 --- a/src/nfs.c +++ b/src/nfs.c @@ -33,9 +33,9 @@ static const char *config_keys[] = {"ReportV2", "ReportV3", "ReportV4"}; static int config_keys_num = STATIC_ARRAY_SIZE(config_keys); -static bool report_v2 = 1; -static bool report_v3 = 1; -static bool report_v4 = 1; +static bool report_v2 = true; +static bool report_v3 = true; +static bool report_v4 = true; /* see /proc/net/rpc/nfs diff --git a/src/ntpd.c b/src/ntpd.c index d0cd94cb..1827dc3e 100644 --- a/src/ntpd.c +++ b/src/ntpd.c @@ -56,7 +56,7 @@ static const char *config_keys[] = {"Host", "Port", "ReverseLookups", "IncludeUnitID"}; static int config_keys_num = STATIC_ARRAY_SIZE(config_keys); -static bool do_reverse_lookups = 1; +static bool do_reverse_lookups = true; /* This option only exists for backward compatibility. If it is false and two * ntpd peers use the same refclock driver, the plugin will try to write diff --git a/src/openvpn.c b/src/openvpn.c index 30254f0d..a80c09fb 100644 --- a/src/openvpn.c +++ b/src/openvpn.c @@ -81,9 +81,9 @@ struct vpn_status_s { typedef struct vpn_status_s vpn_status_t; static bool new_naming_schema; -static bool collect_compression = 1; +static bool collect_compression = true; static bool collect_user_count; -static bool collect_individual_users = 1; +static bool collect_individual_users = true; static const char *config_keys[] = { "StatusFile", "Compression", /* old, deprecated name */ diff --git a/src/perl.c b/src/perl.c index cdacbb77..8c57f576 100644 --- a/src/perl.c +++ b/src/perl.c @@ -183,7 +183,7 @@ extern char **environ; * private variables */ -static bool register_legacy_flush = 1; +static bool register_legacy_flush = true; /* if perl_threads != NULL perl_threads->head must * point to the "base" thread */ diff --git a/src/processes.c b/src/processes.c index 12a63df6..d283d3e1 100644 --- a/src/processes.c +++ b/src/processes.c @@ -295,7 +295,7 @@ typedef struct procstat { static procstat_t *list_head_g = NULL; -static bool want_init = 1; +static bool want_init = true; static bool report_ctx_switch; static bool report_fd_num; static bool report_maps_num; diff --git a/src/rrdcached.c b/src/rrdcached.c index f9c2af39..3d7ae05a 100644 --- a/src/rrdcached.c +++ b/src/rrdcached.c @@ -39,8 +39,8 @@ */ static char *datadir = NULL; static char *daemon_address = NULL; -static bool config_create_files = 1; -static bool config_collect_stats = 1; +static bool config_create_files = true; +static bool config_collect_stats = true; static rrdcreate_config_t rrdcreate_config = { /* stepsize = */ 0, /* heartbeat = */ 0, diff --git a/src/swap.c b/src/swap.c index 5fdb6ea8..2e0939d1 100644 --- a/src/swap.c +++ b/src/swap.c @@ -109,9 +109,9 @@ static int pagesize; #error "No applicable input method." #endif /* HAVE_LIBSTATGRAB */ -static bool values_absolute = 1; +static bool values_absolute = true; static bool values_percentage; -static bool report_io = 1; +static bool report_io = true; static int swap_config(oconfig_item_t *ci) /* {{{ */ { diff --git a/src/turbostat.c b/src/turbostat.c index 89bf3cb5..9a8d7a17 100644 --- a/src/turbostat.c +++ b/src/turbostat.c @@ -195,7 +195,7 @@ static struct pkg_data { #define DELTA_COUNTERS thread_delta, core_delta, package_delta #define ODD_COUNTERS thread_odd, core_odd, package_odd #define EVEN_COUNTERS thread_even, core_even, package_even -static bool is_even = 1; +static bool is_even = true; static bool allocated; static bool initialized; -- 2.11.0