Merge branch 'master' of https://github.com/ckolivas/cgminer.git
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 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
diff --git a/adl.h b/adl.h
index f48c420..ca67550 100644
--- a/adl.h
+++ b/adl.h
@@ -21,8 +21,8 @@ void gpu_autotune(int gpu, enum dev_enable *denable);
void clear_adl(int nDevs);
#else /* HAVE_ADL */
#define adl_active (0)
-static inline void init_adl(int nDevs) {}
-static inline void change_gpusettings(int gpu) { }
-static inline void clear_adl(int nDevs) {}
+static inline void init_adl(__maybe_unused int nDevs) {}
+static inline void change_gpusettings(__maybe_unused int gpu) { }
+static inline void clear_adl(__maybe_unused int nDevs) {}
#endif
#endif
diff --git a/api.c b/api.c
index 6a4d715..f18f7f7 100644
--- a/api.c
+++ b/api.c
@@ -456,13 +456,13 @@ struct CODES {
{ SEVERITY_INFO, MSG_GPUINT, PARAM_BOTH, "GPU %d set new intensity to %s" },
{ SEVERITY_SUCC, MSG_MINECON, PARAM_NONE, "CGMiner config" },
{ SEVERITY_ERR, MSG_GPUMERR, PARAM_BOTH, "Setting GPU %d memoryclock to (%s) reported failure" },
- { SEVERITY_SUCC, MSG_GPUMEM, PARAM_BOTH, "Setting GPU %d memoryclock to (%s) reported succeess" },
+ { SEVERITY_SUCC, MSG_GPUMEM, PARAM_BOTH, "Setting GPU %d memoryclock to (%s) reported success" },
{ SEVERITY_ERR, MSG_GPUEERR, PARAM_BOTH, "Setting GPU %d clock to (%s) reported failure" },
- { SEVERITY_SUCC, MSG_GPUENG, PARAM_BOTH, "Setting GPU %d clock to (%s) reported succeess" },
+ { SEVERITY_SUCC, MSG_GPUENG, PARAM_BOTH, "Setting GPU %d clock to (%s) reported success" },
{ SEVERITY_ERR, MSG_GPUVERR, PARAM_BOTH, "Setting GPU %d vddc to (%s) reported failure" },
- { SEVERITY_SUCC, MSG_GPUVDDC, PARAM_BOTH, "Setting GPU %d vddc to (%s) reported succeess" },
+ { SEVERITY_SUCC, MSG_GPUVDDC, PARAM_BOTH, "Setting GPU %d vddc to (%s) reported success" },
{ SEVERITY_ERR, MSG_GPUFERR, PARAM_BOTH, "Setting GPU %d fan to (%s) reported failure" },
- { SEVERITY_SUCC, MSG_GPUFAN, PARAM_BOTH, "Setting GPU %d fan to (%s) reported succeess" },
+ { SEVERITY_SUCC, MSG_GPUFAN, PARAM_BOTH, "Setting GPU %d fan to (%s) reported success" },
{ SEVERITY_ERR, MSG_MISFN, PARAM_NONE, "Missing save filename parameter" },
{ SEVERITY_ERR, MSG_BADFN, PARAM_STR, "Can't open or create save file '%s'" },
{ SEVERITY_SUCC, MSG_SAVED, PARAM_STR, "Configuration saved to file '%s'" },
diff --git a/cgminer.c b/cgminer.c
index c881fbe..f0b9924 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -3797,7 +3797,7 @@ void *miner_thread(void *userdata)
unsigned long long hashes_done = 0;
unsigned long long hashes;
struct work *work = make_work();
- unsigned const int request_interval = opt_scantime * 2 / 3 ? : 1;
+ const time_t request_interval = opt_scantime * 2 / 3 ? : 1;
unsigned const long request_nonce = MAXTHREADS / 3 * 2;
bool requested = false;
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
diff --git a/driver-modminer.c b/driver-modminer.c
index 3077653..d139091 100644
--- a/driver-modminer.c
+++ b/driver-modminer.c
@@ -164,7 +164,7 @@ fd_set fds;
p = strrchr(buf, '=') ?: p;
if (p[0] == '=')
++p;
- long fwusercode = strtol(p, &p, 16);
+ unsigned long fwusercode = (unsigned long)strtoll(p, &p, 16);
if (p[0] != '\0')
bailout(LOG_ERR, "Bad usercode in ModMiner firmware file");
if (fwusercode == 0xffffffff)
@@ -197,7 +197,7 @@ fd_set fds;
if (6 != write(fd, buf, 6))
bailout2(LOG_ERR, "%s %u: Error programming %s (cmd)", modminer->api->name, modminer->device_id, modminer->device_path);
status_read("cmd reply");
- size_t buflen;
+ ssize_t buflen;
while (len) {
buflen = len < 32 ? len : 32;
if (fread(buf, buflen, 1, f) != 1)
diff --git a/driver-opencl.c b/driver-opencl.c
index dd15687..521a063 100644
--- a/driver-opencl.c
+++ b/driver-opencl.c
@@ -1110,7 +1110,7 @@ out:
return NULL;
}
#else
-void *reinit_gpu(void *userdata)
+void *reinit_gpu(__maybe_unused void *userdata)
{
return NULL;
}
diff --git a/fpgautils.c b/fpgautils.c
index 39f3abd..783015a 100644
--- a/fpgautils.c
+++ b/fpgautils.c
@@ -36,10 +36,10 @@
#include "logging.h"
#include "miner.h"
+#ifdef HAVE_LIBUDEV
char
serial_autodetect_udev(detectone_func_t detectone, const char*prodname)
{
-#ifdef HAVE_LIBUDEV
if (total_devices == MAX_DEVICES)
return 0;
@@ -72,10 +72,14 @@ serial_autodetect_udev(detectone_func_t detectone, const char*prodname)
udev_unref(udev);
return found;
+}
#else
+char
+serial_autodetect_udev(__maybe_unused detectone_func_t detectone, __maybe_unused const char*prodname)
+{
return 0;
-#endif
}
+#endif
char
serial_autodetect_devserial(detectone_func_t detectone, const char*prodname)
@@ -115,7 +119,7 @@ serial_autodetect_devserial(detectone_func_t detectone, const char*prodname)
}
char
-_serial_detect(const char*dnamec, size_t dnamel, detectone_func_t detectone, autoscan_func_t autoscan, bool force_autoscan)
+_serial_detect(const char*dnamec, size_t dnamel, detectone_func_t detectone, autoscan_func_t autoscan, bool forceauto)
{
if (total_devices == MAX_DEVICES)
return 0;
@@ -123,7 +127,6 @@ _serial_detect(const char*dnamec, size_t dnamel, detectone_func_t detectone, aut
struct string_elist *iter, *tmp;
const char*s;
bool inhibitauto = false;
- bool forceauto = false;
char found = 0;
list_for_each_entry_safe(iter, tmp, &scan_devices, list) {
diff --git a/miner.h b/miner.h
index 3af5c88..4e65f22 100644
--- a/miner.h
+++ b/miner.h
@@ -342,7 +342,7 @@ struct cgpu_info {
int virtual_adl;
int intensity;
bool dynamic;
- char *kname;
+ const char *kname;
#ifdef HAVE_OPENCL
cl_uint vwidth;
size_t work_size;