]> git.ipfire.org Git - thirdparty/collectd.git/commitdiff
Set static bools to true instead of 1
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Sun, 13 May 2018 17:05:33 +0000 (19:05 +0200)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Sun, 13 May 2018 17:05:33 +0000 (19:05 +0200)
21 files changed:
src/amqp.c
src/apcups.c
src/bind.c
src/collectd-tg.c
src/cpu.c
src/daemon/plugin.c
src/df.c
src/fhcount.c
src/hugepages.c
src/interface.c
src/libcollectdclient/network_buffer.c
src/memory.c
src/mic.c
src/nfs.c
src/ntpd.c
src/openvpn.c
src/perl.c
src/processes.c
src/rrdcached.c
src/swap.c
src/turbostat.c

index 50711014f73363c18e7c6f85fb8c6b83592be042..6d65bf838d274fc434c4196420aedb582eb5200c 100644 (file)
@@ -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)
 
index f16da90e8daf4323f15ac2945431e5ceb87395c3..622e3a10b37c8dfbd9240842401cdd68f65e4c09 100644 (file)
@@ -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;
 
index 5937d2676984ffb013071deee476f1e5606cc0ae..7af42696913bbdc966cbbb297970831c9ca2b693 100644 (file)
@@ -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;
index 85c5c1b68fd169ae6982f4e47b8e4a6a7d4b0198..6c0a8a5b763e0bfa558f1452ee36b0dadf0760bb 100644 (file)
@@ -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) /* {{{ */
 {
index a0e00d74f4451832291f315f2e8c7bb161ea262d..6db8629377dc99faacadac4927aa9f8f230f861a 100644 (file)
--- 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",
index 3dcd9fce58f5539249ee7011c6a2b7753db3be88..6752a6c12a1f4b32718f17e001de4a0d7bb3fe7d 100644 (file)
@@ -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;
index 7e4c715e02fec3c52ed4063b183c859d8c54ed38..d8108e3f80bcbf6cd91da5337787efc63e901eaf 100644 (file)
--- 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) {
index 9e74dabd79a5582a7ce0c9c7fb5e53ac44bb2a66..05506651fe784ef5c76973c5037fc0bcefbb3a27 100644 (file)
@@ -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) {
index 23db25bfdb6f129a5609c368ad0b4a9a9f4d3a1e..adfc5bb4d92034e249d3e17e53a0e8f53493a876 100644 (file)
 
 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;
 
index e0e08c395d194c2ba3d69dd8b67b8525e262a854..39ca880363aa96b2c888e25e53c49bc23cbad93a 100644 (file)
@@ -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
index 07d3e7676469a5cf4905350213de230e85a92ca0..2332e3ec4dc65c23dc734bf6a93c47da8bda9ddf 100644 (file)
@@ -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;
index ce9ef834d181fe0fddae15a786fb60f7f3054ba0..366ca1c895dd7607c440a696e33cd41746752583 100644 (file)
@@ -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) /* {{{ */
index 55bc684d8bec532f812bc485d5ada42774568d55..b65679e7da226ada84f166c7ccbe2094bafd44aa 100644 (file)
--- 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) {
index 8d5b6309a885b8591f5d472277dc1146b266e3b8..e031cb70a8fb60c626285367d6ad5b2ab638f63e 100644 (file)
--- 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
index d0cd94cb2950910a970d4f99ba90cea1d93920d4..1827dc3e0cbe1863ed4b6258726e47c27ea9c36c 100644 (file)
@@ -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
index 30254f0de6b3dcbd2cc8a4b5bca129ac1e69a511..a80c09fb58e95e886b86f6be4a537c7de1c4bedb 100644 (file)
@@ -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 */
index cdacbb7795ec0060ae24dca4d797d47b99dc28a6..8c57f57640e9480c5068f5cebf162cb67c40285a 100644 (file)
@@ -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 */
index 12a63df67877c062962a809fec9d87ebb81876b5..d283d3e16b34c6136162f0d78cd97a0957c7b4f0 100644 (file)
@@ -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;
index f9c2af39380d3853dda6c362173581ae164a2922..3d7ae05aee9c824b2a16c5a69389a8a5fb2059ce 100644 (file)
@@ -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,
index 5fdb6ea88b0e85fcf1a0b97061e05da15f3112ba..2e0939d16dc938027df9d058b99a87051a1f3089 100644 (file)
@@ -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) /* {{{ */
 {
index 89bf3cb51cba6e2df4fc9e0e08f4f8a0192debe3..9a8d7a17d1cc3ada180f9bb8eeac3ea60e339027 100644 (file)
@@ -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;