Use OPT_WITH_CBARG for all custom parsing functions to allow their values to be written generically when writing the config file from the menu.
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
diff --git a/cgminer.c b/cgminer.c
index b5bebcb..54776c9 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -204,7 +204,7 @@ bool opt_worktime;
#ifdef USE_AVALON
char *opt_avalon_options;
char *opt_bitburner_fury_options;
-static char *opt_set_avalon_van;
+static char *opt_set_avalon_fan;
static char *opt_set_avalon_freq;
#endif
#ifdef USE_AVALON2
@@ -1080,10 +1080,10 @@ static struct opt_table opt_config_table[] = {
OPT_WITH_ARG("--avalon-cutoff",
set_int_0_to_100, opt_show_intval, &opt_avalon_overheat,
"Set avalon overheat cut off temperature"),
- OPT_WITH_ARG("--avalon-fan",
- set_avalon_fan, NULL, &opt_set_avalon_van,
+ OPT_WITH_CBARG("--avalon-fan",
+ set_avalon_fan, NULL, &opt_set_avalon_fan,
"Set fanspeed percentage for avalon, single value or range (default: 20-100)"),
- OPT_WITH_ARG("--avalon-freq",
+ OPT_WITH_CBARG("--avalon-freq",
set_avalon_freq, NULL, &opt_set_avalon_freq,
"Set frequency range for avalon-auto, single value or range"),
OPT_WITH_ARG("--avalon-options",
@@ -1094,13 +1094,13 @@ static struct opt_table opt_config_table[] = {
"Set avalon target temperature"),
#endif
#ifdef USE_AVALON2
- OPT_WITH_ARG("--avalon2-freq",
+ OPT_WITH_CBARG("--avalon2-freq",
set_avalon2_freq, NULL, &opt_set_avalon2_freq,
"Set frequency range for Avalon2, single value or range"),
- OPT_WITH_ARG("--avalon2-fan",
+ OPT_WITH_CBARG("--avalon2-fan",
set_avalon2_fan, NULL, &opt_set_avalon2_fan,
"Set Avalon2 target fan speed"),
- OPT_WITH_ARG("--avalon2-voltage",
+ OPT_WITH_CBARG("--avalon2-voltage",
set_avalon2_voltage, NULL, &opt_set_avalon2_voltage,
"Set Avalon2 core voltage, in millivolts"),
#endif
@@ -1149,10 +1149,10 @@ static struct opt_table opt_config_table[] = {
OPT_WITH_ARG("--bitmain-cutoff",
set_int_0_to_100, opt_show_intval, &opt_bitmain_overheat,
"Set bitmain overheat cut off temperature"),
- OPT_WITH_ARG("--bitmain-fan",
+ OPT_WITH_CBARG("--bitmain-fan",
set_bitmain_fan, NULL, &opt_set_bitmain_fan,
"Set fanspeed percentage for bitmain, single value or range (default: 20-100)"),
- OPT_WITH_ARG("--bitmain-freq",
+ OPT_WITH_CBARG("--bitmain-freq",
set_bitmain_freq, NULL, &opt_set_bitmain_freq,
"Set frequency range for bitmain-auto, single value or range"),
OPT_WITHOUT_ARG("--bitmain-hwerror",
@@ -1235,7 +1235,7 @@ static struct opt_table opt_config_table[] = {
OPT_WITH_ARG("--hfa-fail-drop",
set_int_0_to_100, opt_show_intval, &opt_hfa_fail_drop,
"Set how many MHz to drop clockspeed each failure on an overlocked hashfast device"),
- OPT_WITH_ARG("--hfa-fan",
+ OPT_WITH_CBARG("--hfa-fan",
set_hfa_fan, NULL, &opt_set_hfa_fan,
"Set fanspeed percentage for hashfast, single value or range (default: 10-85)"),
OPT_WITH_ARG("--hfa-name",
@@ -1350,20 +1350,20 @@ static struct opt_table opt_config_table[] = {
set_rr, &pool_strategy,
"Change multipool strategy from failover to round robin on failure"),
#ifdef USE_FPGA_SERIAL
- OPT_WITH_ARG("--scan-serial|-S",
+ OPT_WITH_CBARG("--scan-serial|-S",
add_serial, NULL, &opt_add_serial,
"Serial port to probe for Serial FPGA Mining device"),
#endif
OPT_WITH_ARG("--scan-time|-s",
set_int_0_to_9999, opt_show_intval, &opt_scantime,
"Upper bound on time spent scanning current work, in seconds"),
- OPT_WITH_ARG("--sched-start",
+ OPT_WITH_CBARG("--sched-start",
set_sched_start, NULL, &opt_set_sched_start,
"Set a time of day in HH:MM to start mining (a once off without a stop time)"),
- OPT_WITH_ARG("--sched-stop",
+ OPT_WITH_CBARG("--sched-stop",
set_sched_stop, NULL, &opt_set_sched_stop,
"Set a time of day in HH:MM to stop mining (will quit without a start time)"),
- OPT_WITH_ARG("--sharelog",
+ OPT_WITH_CBARG("--sharelog",
set_sharelog, NULL, &opt_set_sharelog,
"Append share log to file"),
OPT_WITH_ARG("--shares",
@@ -1378,7 +1378,7 @@ static struct opt_table opt_config_table[] = {
"Use system log for output messages (default: standard error)"),
#endif
#if defined(USE_BITFORCE) || defined(USE_MODMINER) || defined(USE_BFLSC)
- OPT_WITH_ARG("--temp-cutoff",
+ OPT_WITH_CBARG("--temp-cutoff",
set_temp_cutoff, opt_show_intval, &opt_set_temp_cutoff,
"Temperature where a device will be automatically disabled, one value or comma separated list"),
#endif
@@ -4869,7 +4869,7 @@ void write_config(FILE *fcfg)
continue;
}
- if (opt->type & OPT_HASARG &&
+ if (opt->type & (OPT_HASARG | OPT_PROCESSARG) &&
(opt->u.arg != &opt_set_null)) {
char *carg = *(char **)opt->u.arg;