diff --git a/driver-opencl.c b/driver-opencl.c index 6a8c2a07..93a46d93 100644 --- a/driver-opencl.c +++ b/driver-opencl.c @@ -1188,7 +1188,7 @@ static void opencl_detect(bool hotplug) cgpu->threads = 1; #endif cgpu->virtual_gpu = i; - cgpu->algorithm = *default_algorithm; + cgpu->algorithm = *opt_algorithm; add_cgpu(cgpu); } diff --git a/miner.h b/miner.h index 9dda3a71..bcc837e2 100644 --- a/miner.h +++ b/miner.h @@ -1015,7 +1015,7 @@ extern int opt_queue; extern int opt_scantime; extern int opt_expiry; -extern algorithm_t *default_algorithm; +extern algorithm_t *opt_algorithm; extern cglock_t control_lock; extern pthread_mutex_t hash_lock; diff --git a/ocl.h b/ocl.h index 2604ab6e..1874e90e 100644 --- a/ocl.h +++ b/ocl.h @@ -37,4 +37,3 @@ extern int clDevicesNum(void); extern _clState *initCl(unsigned int gpu, char *name, size_t nameSize, algorithm_t *algorithm); #endif /* OCL_H */ - diff --git a/sgminer.c b/sgminer.c index acbd7e1a..c092a5a5 100644 --- a/sgminer.c +++ b/sgminer.c @@ -98,7 +98,7 @@ int opt_queue = 1; int opt_scantime = 7; int opt_expiry = 28; -algorithm_t *default_algorithm; +algorithm_t *opt_algorithm; static const bool opt_time = true; unsigned long long global_hashrate; @@ -543,7 +543,7 @@ struct pool *add_pool(void) pool->name = strdup(buf); /* Algorithm */ - pool->algorithm = *default_algorithm; + pool->algorithm = *opt_algorithm; pools = (struct pool **)realloc(pools, sizeof(struct pool *) * (total_pools + 2)); pools[total_pools++] = pool; @@ -1070,17 +1070,17 @@ static void load_temp_cutoffs() static char *set_algo(const char *arg) { - set_algorithm(default_algorithm, arg); - applog(LOG_INFO, "Set default algorithm to %s", default_algorithm->name); + set_algorithm(opt_algorithm, arg); + applog(LOG_INFO, "Set default algorithm to %s", opt_algorithm->name); return NULL; } static char *set_nfactor(const char *arg) { - set_algorithm_nfactor(default_algorithm, (const uint8_t) atoi(arg)); + set_algorithm_nfactor(opt_algorithm, (const uint8_t) atoi(arg)); applog(LOG_INFO, "Set algorithm N-factor to %d (N to %d)", - default_algorithm->nfactor, default_algorithm->n); + opt_algorithm->nfactor, opt_algorithm->n); return NULL; } @@ -4456,8 +4456,8 @@ void write_config(FILE *fcfg) } if (opt_removedisabled) fprintf(fcfg, ",\n\"remove-disabled\" : true"); - if (strcmp(default_algorithm->name, "scrypt") != 0) - fprintf(fcfg, ",\n\"algorithm\" : \"%s\"", json_escape(default_algorithm->name)); + if (strcmp(opt_algorithm->name, "scrypt") != 0) + fprintf(fcfg, ",\n\"algorithm\" : \"%s\"", json_escape(opt_algorithm->name)); if (opt_api_allow) fprintf(fcfg, ",\n\"api-allow\" : \"%s\"", json_escape(opt_api_allow)); if (strcmp(opt_api_mcast_addr, API_MCAST_ADDR) != 0) @@ -7985,8 +7985,8 @@ int main(int argc, char *argv[]) #endif /* Default algorithm specified in algorithm.c ATM */ - default_algorithm = (algorithm_t *)alloca(sizeof(algorithm_t)); - set_algorithm(default_algorithm, "scrypt"); + opt_algorithm = (algorithm_t *)alloca(sizeof(algorithm_t)); + set_algorithm(opt_algorithm, "scrypt"); devcursor = 8; logstart = devcursor + 1;