Don't initialise variables to zero when in global scope since they're already initialised.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
diff --git a/cgminer.c b/cgminer.c
index 3866465..d38cd1d 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -79,14 +79,14 @@ static char packagename[255];
int gpu_threads;
-bool opt_protocol = false;
+bool opt_protocol;
static bool opt_benchmark;
-static bool have_longpoll = false;
-static bool want_per_device_stats = false;
-bool use_syslog = false;
-static bool opt_quiet = false;
-static bool opt_realquiet = false;
-bool opt_loginput = false;
+static bool have_longpoll;
+static bool want_per_device_stats;
+bool use_syslog;
+static bool opt_quiet;
+static bool opt_realquiet;
+bool opt_loginput;
const int opt_cutofftemp = 95;
static int opt_retries = -1;
static int opt_fail_pause = 5;
@@ -107,22 +107,20 @@ static bool opt_nogpu;
struct list_head scan_devices;
int nDevs;
int opt_g_threads = 2;
-static signed int devices_enabled = 0;
-static bool opt_removedisabled = false;
-int total_devices = 0;
+static signed int devices_enabled;
+static bool opt_removedisabled;
+int total_devices;
struct cgpu_info *devices[MAX_DEVICES];
-bool have_opencl = false;
+bool have_opencl;
int gpu_threads;
int opt_n_threads = -1;
int mining_threads;
int num_processors;
-bool use_curses =
#ifdef HAVE_CURSES
- true
+bool use_curses = true;
#else
- false
+bool use_curses;
#endif
-;
static bool opt_submit_stale = true;
static int opt_shares;
static bool opt_fail_only;
@@ -132,9 +130,9 @@ bool opt_noadl;
char *opt_api_allow = NULL;
char *opt_api_description = PACKAGE_STRING;
int opt_api_port = 4028;
-bool opt_api_listen = false;
-bool opt_api_network = false;
-bool opt_delaynet = false;
+bool opt_api_listen;
+bool opt_api_network;
+bool opt_delaynet;
bool opt_disable_pool = true;
char *opt_kernel_path;
@@ -194,7 +192,7 @@ static int total_urls, total_users, total_passes, total_userpasses;
#ifndef HAVE_CURSES
const
#endif
-static bool curses_active = false;
+static bool curses_active;
static char current_block[37];
static char *current_hash;
@@ -211,8 +209,8 @@ static struct block *blocks = NULL;
char *opt_socks_proxy = NULL;
static const char def_conf[] = "cgminer.conf";
-static bool config_loaded = false;
-static int include_count = 0;
+static bool config_loaded;
+static int include_count;
#define JSON_INCLUDE_CONF "include"
#define JSON_LOAD_ERROR "JSON decode of file '%s' failed"
#define JSON_LOAD_ERROR_LEN strlen(JSON_LOAD_ERROR)
@@ -221,7 +219,7 @@ static int include_count = 0;
#if defined(unix)
static char *opt_stderr_cmd = NULL;
- static int forkpid = 0;
+ static int forkpid;
#endif // defined(unix)
bool ping = true;