Add support for all the integer range options 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
diff --git a/cgminer.c b/cgminer.c
index 3b0a2ea..44222f6 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -692,31 +692,25 @@ static char *set_int_0_to_10(const char *arg, int *i)
return set_int_range(arg, i, 0, 10);
}
-static char __maybe_unused *set_int_0_to_100(const char *arg, int *i)
+static char *set_int_0_to_100(const char *arg, int *i)
{
return set_int_range(arg, i, 0, 100);
}
-#ifdef USE_COINTERRA
static char *set_int_0_to_255(const char *arg, int *i)
{
return set_int_range(arg, i, 0, 255);
}
-#endif
-#if defined(USE_BFLSC) || defined(USE_BITFURY) || defined(USE_HASHFAST)
static char *set_int_0_to_200(const char *arg, int *i)
{
return set_int_range(arg, i, 0, 200);
}
-#endif
-#ifdef USE_BITFURY
static char *set_int_32_to_63(const char *arg, int *i)
{
return set_int_range(arg, i, 32, 63);
}
-#endif
static char *set_int_1_to_10(const char *arg, int *i)
{
@@ -4956,7 +4950,12 @@ void write_config(FILE *fcfg)
((void *)opt->cb_arg == (void *)set_int_0_to_9999 ||
(void *)opt->cb_arg == (void *)set_int_1_to_65535 ||
(void *)opt->cb_arg == (void *)set_int_0_to_10 ||
- (void *)opt->cb_arg == (void *)set_int_1_to_10) && opt->desc != opt_hidden)
+ (void *)opt->cb_arg == (void *)set_int_1_to_10 ||
+ (void *)opt->cb_arg == (void *)set_int_0_to_100 ||
+ (void *)opt->cb_arg == (void *)set_int_0_to_255 ||
+ (void *)opt->cb_arg == (void *)set_int_0_to_200 ||
+ (void *)opt->cb_arg == (void *)set_int_32_to_63) &&
+ opt->desc != opt_hidden)
fprintf(fcfg, ",\n\"%s\" : \"%d\"", p+2, *(int *)opt->u.arg);
}
}