Do not use designated initializers
This commit is contained in:
parent
2615c25425
commit
bbe3ec2fa8
16
src/pow.cc
16
src/pow.cc
|
@ -111,13 +111,13 @@ int pow(size_t pool_size,
|
||||||
pthread_mutex_t mutex;
|
pthread_mutex_t mutex;
|
||||||
pthread_mutex_init(&mutex, NULL);
|
pthread_mutex_init(&mutex, NULL);
|
||||||
PowArgs pow_args = {
|
PowArgs pow_args = {
|
||||||
.pool_size = pool_size,
|
pool_size,
|
||||||
.target = target,
|
target,
|
||||||
.initial_hash = initial_hash,
|
initial_hash,
|
||||||
.max_nonce = max_nonce ? max_nonce : INT64_MAX,
|
max_nonce ? max_nonce : INT64_MAX,
|
||||||
.result = RESULT_NOT_READY,
|
RESULT_NOT_READY,
|
||||||
.nonce = 0,
|
0,
|
||||||
.mutex = &mutex,
|
&mutex,
|
||||||
};
|
};
|
||||||
ThreadArgs threads_args[pool_size];
|
ThreadArgs threads_args[pool_size];
|
||||||
pthread_t threads[pool_size];
|
pthread_t threads[pool_size];
|
||||||
|
@ -126,7 +126,7 @@ int pow(size_t pool_size,
|
||||||
|
|
||||||
// Spawn threads.
|
// Spawn threads.
|
||||||
for (i = 0; i < pool_size; i++) {
|
for (i = 0; i < pool_size; i++) {
|
||||||
ThreadArgs args = {.num = i, .pow_args = &pow_args};
|
ThreadArgs args = {i, &pow_args};
|
||||||
threads_args[i] = args;
|
threads_args[i] = args;
|
||||||
error = pthread_create(&threads[i], NULL, pow_thread, &threads_args[i]);
|
error = pthread_create(&threads[i], NULL, pow_thread, &threads_args[i]);
|
||||||
if (error) {
|
if (error) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user