Fix missing field initialisers warnings.
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
diff --git a/bitforce.c b/bitforce.c
index 005a632..bd1a562 100644
--- a/bitforce.c
+++ b/bitforce.c
@@ -192,7 +192,7 @@ static bool bitforce_thread_prepare(struct thr_info *thr)
return true;
}
-static uint64_t bitforce_scanhash(struct thr_info *thr, struct work *work, uint64_t max_nonce)
+static uint64_t bitforce_scanhash(struct thr_info *thr, struct work *work, uint64_t __maybe_unused max_nonce)
{
struct cgpu_info *bitforce = thr->cgpu;
int fdDev = bitforce->device_fd;
diff --git a/cgminer.c b/cgminer.c
index 00fc686..7cf1a91 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -1701,7 +1701,7 @@ void kill_work(void)
void quit(int status, const char *format, ...);
-static void sighandler(int sig)
+static void sighandler(int __maybe_unused sig)
{
/* Restore signal handlers so we can still quit if kill_work fails */
sigaction(SIGTERM, &termhandler, NULL);
@@ -3073,7 +3073,7 @@ static bool get_work(struct work *work, bool requested, struct thr_info *thr,
const int thr_id)
{
bool newreq = false, ret = false;
- struct timespec abstime = {};
+ struct timespec abstime = {0, 0};
struct timeval now;
struct work *work_heap;
struct pool *pool;
diff --git a/logging.c b/logging.c
index b5c4b64..d193444 100644
--- a/logging.c
+++ b/logging.c
@@ -25,7 +25,7 @@ void vapplog(int prio, const char *fmt, va_list ap)
else if (opt_log_output || prio <= LOG_NOTICE) {
char *f;
int len;
- struct timeval tv = { };
+ struct timeval tv = {0, 0};
struct tm *tm;
gettimeofday(&tv, NULL);
@@ -79,7 +79,7 @@ void applog(int prio, const char *fmt, ...)
* generic log function used by priority specific ones
* equals vapplog() without additional priority checks
*/
-static void log_generic(int prio, const char *fmt, va_list ap)
+static void __maybe_unused log_generic(int prio, const char *fmt, va_list ap)
{
extern bool use_curses;
#ifdef HAVE_SYSLOG_H
@@ -92,7 +92,7 @@ static void log_generic(int prio, const char *fmt, va_list ap)
else {
char *f;
int len;
- struct timeval tv = { };
+ struct timeval tv = {0, 0};
struct tm *tm;
gettimeofday(&tv, NULL);
diff --git a/util.c b/util.c
index 660107b..1b073e3 100644
--- a/util.c
+++ b/util.c
@@ -254,14 +254,14 @@ json_t *json_rpc_call(CURL *curl, const char *url,
{
json_t *val, *err_val, *res_val;
int rc;
- struct data_buffer all_data = { };
+ struct data_buffer all_data = {NULL, 0};
struct upload_buffer upload_data;
- json_error_t err = { };
+ json_error_t err = {0, 0, 0, "", ""};
struct curl_slist *headers = NULL;
char len_hdr[64], user_agent_hdr[128];
char curl_err_str[CURL_ERROR_SIZE];
long timeout = longpoll ? (60 * 60) : 60;
- struct header_info hi = { };
+ struct header_info hi = {NULL, false, NULL};
bool probing = false;
/* it is assumed that 'curl' is freshly [re]initialized at this pt */