mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-23 21:14:18 +00:00
Merge pull request #223 from luke-jr/bugfix_warnings
Fix a bunch of warnings
This commit is contained in:
commit
8f76d15fae
6
adl.h
6
adl.h
@ -21,8 +21,8 @@ void gpu_autotune(int gpu, enum dev_enable *denable);
|
|||||||
void clear_adl(int nDevs);
|
void clear_adl(int nDevs);
|
||||||
#else /* HAVE_ADL */
|
#else /* HAVE_ADL */
|
||||||
#define adl_active (0)
|
#define adl_active (0)
|
||||||
static inline void init_adl(int nDevs) {}
|
static inline void init_adl(__maybe_unused int nDevs) {}
|
||||||
static inline void change_gpusettings(int gpu) { }
|
static inline void change_gpusettings(__maybe_unused int gpu) { }
|
||||||
static inline void clear_adl(int nDevs) {}
|
static inline void clear_adl(__maybe_unused int nDevs) {}
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -3797,7 +3797,7 @@ void *miner_thread(void *userdata)
|
|||||||
unsigned long long hashes_done = 0;
|
unsigned long long hashes_done = 0;
|
||||||
unsigned long long hashes;
|
unsigned long long hashes;
|
||||||
struct work *work = make_work();
|
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;
|
unsigned const long request_nonce = MAXTHREADS / 3 * 2;
|
||||||
bool requested = false;
|
bool requested = false;
|
||||||
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
|
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL);
|
||||||
|
@ -164,7 +164,7 @@ fd_set fds;
|
|||||||
p = strrchr(buf, '=') ?: p;
|
p = strrchr(buf, '=') ?: p;
|
||||||
if (p[0] == '=')
|
if (p[0] == '=')
|
||||||
++p;
|
++p;
|
||||||
long fwusercode = strtol(p, &p, 16);
|
unsigned long fwusercode = (unsigned long)strtoll(p, &p, 16);
|
||||||
if (p[0] != '\0')
|
if (p[0] != '\0')
|
||||||
bailout(LOG_ERR, "Bad usercode in ModMiner firmware file");
|
bailout(LOG_ERR, "Bad usercode in ModMiner firmware file");
|
||||||
if (fwusercode == 0xffffffff)
|
if (fwusercode == 0xffffffff)
|
||||||
@ -197,7 +197,7 @@ fd_set fds;
|
|||||||
if (6 != write(fd, buf, 6))
|
if (6 != write(fd, buf, 6))
|
||||||
bailout2(LOG_ERR, "%s %u: Error programming %s (cmd)", modminer->api->name, modminer->device_id, modminer->device_path);
|
bailout2(LOG_ERR, "%s %u: Error programming %s (cmd)", modminer->api->name, modminer->device_id, modminer->device_path);
|
||||||
status_read("cmd reply");
|
status_read("cmd reply");
|
||||||
size_t buflen;
|
ssize_t buflen;
|
||||||
while (len) {
|
while (len) {
|
||||||
buflen = len < 32 ? len : 32;
|
buflen = len < 32 ? len : 32;
|
||||||
if (fread(buf, buflen, 1, f) != 1)
|
if (fread(buf, buflen, 1, f) != 1)
|
||||||
|
@ -1110,7 +1110,7 @@ out:
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
void *reinit_gpu(void *userdata)
|
void *reinit_gpu(__maybe_unused void *userdata)
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
15
fpgautils.c
15
fpgautils.c
@ -36,10 +36,10 @@
|
|||||||
#include "logging.h"
|
#include "logging.h"
|
||||||
#include "miner.h"
|
#include "miner.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_LIBUDEV
|
||||||
char
|
char
|
||||||
serial_autodetect_udev(detectone_func_t detectone, const char*prodname)
|
serial_autodetect_udev(detectone_func_t detectone, const char*prodname)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_LIBUDEV
|
|
||||||
if (total_devices == MAX_DEVICES)
|
if (total_devices == MAX_DEVICES)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -72,10 +72,14 @@ serial_autodetect_udev(detectone_func_t detectone, const char*prodname)
|
|||||||
udev_unref(udev);
|
udev_unref(udev);
|
||||||
|
|
||||||
return found;
|
return found;
|
||||||
#else
|
|
||||||
return 0;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
char
|
||||||
|
serial_autodetect_udev(__maybe_unused detectone_func_t detectone, __maybe_unused const char*prodname)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
char
|
char
|
||||||
serial_autodetect_devserial(detectone_func_t detectone, const char*prodname)
|
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
|
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)
|
if (total_devices == MAX_DEVICES)
|
||||||
return 0;
|
return 0;
|
||||||
@ -123,7 +127,6 @@ _serial_detect(const char*dnamec, size_t dnamel, detectone_func_t detectone, aut
|
|||||||
struct string_elist *iter, *tmp;
|
struct string_elist *iter, *tmp;
|
||||||
const char*s;
|
const char*s;
|
||||||
bool inhibitauto = false;
|
bool inhibitauto = false;
|
||||||
bool forceauto = false;
|
|
||||||
char found = 0;
|
char found = 0;
|
||||||
|
|
||||||
list_for_each_entry_safe(iter, tmp, &scan_devices, list) {
|
list_for_each_entry_safe(iter, tmp, &scan_devices, list) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user