mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-09 14:28:12 +00:00
rename poorly named variable
This commit is contained in:
parent
a96048e782
commit
485ec9ac88
12
api.c
12
api.c
@ -2750,13 +2750,13 @@ static void debugstate(struct io_data *io_data, __maybe_unused SOCKETTYPE c, cha
|
||||
opt_quiet ^= true;
|
||||
break;
|
||||
case 'v':
|
||||
opt_log_output ^= true;
|
||||
if (opt_log_output)
|
||||
opt_verbose ^= true;
|
||||
if (opt_verbose)
|
||||
opt_quiet = false;
|
||||
break;
|
||||
case 'd':
|
||||
opt_debug ^= true;
|
||||
opt_log_output = opt_debug;
|
||||
opt_verbose = opt_debug;
|
||||
if (opt_debug)
|
||||
opt_quiet = false;
|
||||
break;
|
||||
@ -2767,10 +2767,10 @@ static void debugstate(struct io_data *io_data, __maybe_unused SOCKETTYPE c, cha
|
||||
break;
|
||||
case 'p':
|
||||
want_per_device_stats ^= true;
|
||||
opt_log_output = want_per_device_stats;
|
||||
opt_verbose = want_per_device_stats;
|
||||
break;
|
||||
case 'n':
|
||||
opt_log_output = false;
|
||||
opt_verbose = false;
|
||||
opt_debug = false;
|
||||
opt_quiet = false;
|
||||
opt_protocol = false;
|
||||
@ -2798,7 +2798,7 @@ static void debugstate(struct io_data *io_data, __maybe_unused SOCKETTYPE c, cha
|
||||
|
||||
root = api_add_bool(root, "Silent", &opt_realquiet, false);
|
||||
root = api_add_bool(root, "Quiet", &opt_quiet, false);
|
||||
root = api_add_bool(root, "Verbose", &opt_log_output, false);
|
||||
root = api_add_bool(root, "Verbose", &opt_verbose, false);
|
||||
root = api_add_bool(root, "Debug", &opt_debug, false);
|
||||
root = api_add_bool(root, "RPCProto", &opt_protocol, false);
|
||||
root = api_add_bool(root, "PerDevice", &want_per_device_stats, false);
|
||||
|
@ -667,7 +667,7 @@ char *set_rawintensity(const char *_arg)
|
||||
|
||||
void print_ndevs(int *ndevs)
|
||||
{
|
||||
opt_log_output = true;
|
||||
opt_verbose = true;
|
||||
opencl_drv.drv_detect();
|
||||
clear_adl(*ndevs);
|
||||
applog(LOG_INFO, "%i GPU devices max detected", *ndevs);
|
||||
|
12
logging.c
12
logging.c
@ -16,7 +16,7 @@
|
||||
#include "miner.h"
|
||||
|
||||
bool opt_debug = false;
|
||||
bool opt_log_output = false;
|
||||
bool opt_verbose = false;
|
||||
int last_date_output_day = 0;
|
||||
int opt_log_show_date = false;
|
||||
|
||||
@ -47,7 +47,7 @@ static void my_log_curses(int prio, const char *datetime, const char *str, bool
|
||||
}
|
||||
}
|
||||
|
||||
void applog(int prio, const char* fmt, ...)
|
||||
void applog(int prio, const char* fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
@ -56,7 +56,7 @@ void applog(int prio, const char* fmt, ...)
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
void applogsiz(int prio, int size, const char* fmt, ...)
|
||||
void applogsiz(int prio, int size, const char* fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
@ -66,10 +66,10 @@ void applogsiz(int prio, int size, const char* fmt, ...)
|
||||
}
|
||||
|
||||
/* high-level logging function, based on global opt_log_level */
|
||||
void vapplogsiz(int prio, int size, const char* fmt, va_list args)
|
||||
void vapplogsiz(int prio, int size, const char* fmt, va_list args)
|
||||
{
|
||||
if (opt_debug || prio != LOG_DEBUG) {
|
||||
if (use_syslog || opt_log_output || prio <= opt_log_level) {
|
||||
if (use_syslog || opt_verbose || prio <= opt_log_level) {
|
||||
char *tmp42 = (char *)calloc(size + 1, 1);
|
||||
vsnprintf(tmp42, size, fmt, args);
|
||||
_applog(prio, tmp42, false);
|
||||
@ -132,7 +132,7 @@ void _applog(int prio, const char *str, bool force)
|
||||
fprintf(stderr, "%s%s\n", datetime, str); /* atomic write to stderr */
|
||||
fflush(stderr);
|
||||
}
|
||||
|
||||
|
||||
my_log_curses(prio, datetime, str, force);
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ enum {
|
||||
|
||||
/* debug flags */
|
||||
extern bool opt_debug;
|
||||
extern bool opt_log_output;
|
||||
extern bool opt_verbose;
|
||||
extern bool opt_realquiet;
|
||||
extern bool want_per_device_stats;
|
||||
|
||||
@ -40,7 +40,7 @@ extern void _applog(int prio, const char *str, bool force);
|
||||
|
||||
#define forcelog(prio, fmt, ...) do { \
|
||||
if (opt_debug || prio != LOG_DEBUG) { \
|
||||
if (use_syslog || opt_log_output || prio <= opt_log_level) { \
|
||||
if (use_syslog || opt_verbose || prio <= opt_log_level) { \
|
||||
char tmp42[LOGBUFSIZ]; \
|
||||
snprintf(tmp42, sizeof(tmp42), fmt, ##__VA_ARGS__); \
|
||||
_applog(prio, tmp42, true); \
|
||||
|
20
sgminer.c
20
sgminer.c
@ -1101,7 +1101,7 @@ static char *enable_debug(bool *flag)
|
||||
{
|
||||
*flag = true;
|
||||
/* Turn on verbose output, too. */
|
||||
opt_log_output = true;
|
||||
opt_verbose = true;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -1688,7 +1688,7 @@ struct opt_table opt_config_table[] = {
|
||||
/* All current kernels only support vectors=1 */
|
||||
/* "Override detected optimal vector (1, 2 or 4) - one value or comma separated list"), */
|
||||
OPT_WITHOUT_ARG("--verbose|-v",
|
||||
opt_set_bool, &opt_log_output,
|
||||
opt_set_bool, &opt_verbose,
|
||||
"Log verbose output to stderr as well as status output"),
|
||||
OPT_WITH_ARG("--worksize|-w",
|
||||
set_default_worksize, NULL, NULL,
|
||||
@ -4634,7 +4634,7 @@ retry:
|
||||
opt_debug ? "on" : "off",
|
||||
want_per_device_stats? "on" : "off",
|
||||
opt_quiet ? "on" : "off",
|
||||
opt_log_output ? "on" : "off",
|
||||
opt_verbose ? "on" : "off",
|
||||
opt_protocol ? "on" : "off",
|
||||
opt_worktime ? "on" : "off",
|
||||
opt_incognito ? "on" : "off",
|
||||
@ -4648,13 +4648,13 @@ retry:
|
||||
wlogprint("Quiet mode %s\n", opt_quiet ? "enabled" : "disabled");
|
||||
goto retry;
|
||||
} else if (!strncasecmp(&input, "v", 1)) {
|
||||
opt_log_output ^= true;
|
||||
if (opt_log_output)
|
||||
opt_verbose ^= true;
|
||||
if (opt_verbose)
|
||||
opt_quiet = false;
|
||||
wlogprint("Verbose mode %s\n", opt_log_output ? "enabled" : "disabled");
|
||||
wlogprint("Verbose mode %s\n", opt_verbose ? "enabled" : "disabled");
|
||||
goto retry;
|
||||
} else if (!strncasecmp(&input, "n", 1)) {
|
||||
opt_log_output = false;
|
||||
opt_verbose = false;
|
||||
opt_debug = false;
|
||||
opt_quiet = false;
|
||||
opt_protocol = false;
|
||||
@ -4665,7 +4665,7 @@ retry:
|
||||
goto retry;
|
||||
} else if (!strncasecmp(&input, "d", 1)) {
|
||||
opt_debug ^= true;
|
||||
opt_log_output = opt_debug;
|
||||
opt_verbose = opt_debug;
|
||||
if (opt_debug)
|
||||
opt_quiet = false;
|
||||
wlogprint("Debug mode %s\n", opt_debug ? "enabled" : "disabled");
|
||||
@ -4681,7 +4681,7 @@ retry:
|
||||
goto retry;
|
||||
} else if (!strncasecmp(&input, "p", 1)) {
|
||||
want_per_device_stats ^= true;
|
||||
opt_log_output = want_per_device_stats;
|
||||
opt_verbose = want_per_device_stats;
|
||||
wlogprint("Per-device stats %s\n", want_per_device_stats ? "enabled" : "disabled");
|
||||
goto retry;
|
||||
} else if (!strncasecmp(&input, "r", 1)) {
|
||||
@ -8284,7 +8284,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
if (want_per_device_stats)
|
||||
opt_log_output = true;
|
||||
opt_verbose = true;
|
||||
|
||||
total_control_threads = 8;
|
||||
control_thr = (struct thr_info *)calloc(total_control_threads, sizeof(*thr));
|
||||
|
Loading…
Reference in New Issue
Block a user