Browse Source

fix compiler warnings

djm34
Jan Berdajs 11 years ago
parent
commit
6c5ce535d9
  1. 4
      animecoin.c
  2. 4
      darkcoin.c
  3. 22
      driver-opencl.c
  4. 14
      driver-opencl.h
  5. 4
      fuguecoin.c
  6. 5
      groestlcoin.c
  7. 4
      inkcoin.c
  8. 4
      marucoin.c
  9. 4
      myriadcoin-groestl.c
  10. 4
      quarkcoin.c
  11. 4
      qubitcoin.c
  12. 14
      sgminer.c
  13. 4
      sifcoin.c
  14. 4
      twecoin.c
  15. 2
      util.c
  16. 1
      util.h

4
animecoin.c

@ -149,11 +149,9 @@ int animecoin_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t
{ {
uint32_t tmp_hash7, Htarg = le32toh(((const uint32_t *)ptarget)[7]); uint32_t tmp_hash7, Htarg = le32toh(((const uint32_t *)ptarget)[7]);
uint32_t data[20], ohash[8]; uint32_t data[20], ohash[8];
//char *scratchbuf;
be32enc_vect(data, (const uint32_t *)pdata, 19); be32enc_vect(data, (const uint32_t *)pdata, 19);
data[19] = htobe32(nonce); data[19] = htobe32(nonce);
//scratchbuf = alloca(SCRATCHBUF_SIZE);
animehash(ohash, data); animehash(ohash, data);
tmp_hash7 = be32toh(ohash[7]); tmp_hash7 = be32toh(ohash[7]);
@ -171,7 +169,6 @@ int animecoin_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t
void animecoin_regenhash(struct work *work) void animecoin_regenhash(struct work *work)
{ {
uint32_t data[20]; uint32_t data[20];
char *scratchbuf;
uint32_t *nonce = (uint32_t *)(work->data + 76); uint32_t *nonce = (uint32_t *)(work->data + 76);
uint32_t *ohash = (uint32_t *)(work->hash); uint32_t *ohash = (uint32_t *)(work->hash);
@ -186,7 +183,6 @@ bool scanhash_animecoin(struct thr_info *thr, const unsigned char __maybe_unused
uint32_t max_nonce, uint32_t *last_nonce, uint32_t n) uint32_t max_nonce, uint32_t *last_nonce, uint32_t n)
{ {
uint32_t *nonce = (uint32_t *)(pdata + 76); uint32_t *nonce = (uint32_t *)(pdata + 76);
char *scratchbuf;
uint32_t data[20]; uint32_t data[20];
uint32_t tmp_hash7; uint32_t tmp_hash7;
uint32_t Htarg = le32toh(((const uint32_t *)ptarget)[7]); uint32_t Htarg = le32toh(((const uint32_t *)ptarget)[7]);

4
darkcoin.c

@ -149,11 +149,9 @@ int darkcoin_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t n
{ {
uint32_t tmp_hash7, Htarg = le32toh(((const uint32_t *)ptarget)[7]); uint32_t tmp_hash7, Htarg = le32toh(((const uint32_t *)ptarget)[7]);
uint32_t data[20], ohash[8]; uint32_t data[20], ohash[8];
//char *scratchbuf;
be32enc_vect(data, (const uint32_t *)pdata, 19); be32enc_vect(data, (const uint32_t *)pdata, 19);
data[19] = htobe32(nonce); data[19] = htobe32(nonce);
//scratchbuf = alloca(SCRATCHBUF_SIZE);
xhash(ohash, data); xhash(ohash, data);
tmp_hash7 = be32toh(ohash[7]); tmp_hash7 = be32toh(ohash[7]);
@ -171,7 +169,6 @@ int darkcoin_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t n
void darkcoin_regenhash(struct work *work) void darkcoin_regenhash(struct work *work)
{ {
uint32_t data[20]; uint32_t data[20];
char *scratchbuf;
uint32_t *nonce = (uint32_t *)(work->data + 76); uint32_t *nonce = (uint32_t *)(work->data + 76);
uint32_t *ohash = (uint32_t *)(work->hash); uint32_t *ohash = (uint32_t *)(work->hash);
@ -186,7 +183,6 @@ bool scanhash_darkcoin(struct thr_info *thr, const unsigned char __maybe_unused
uint32_t max_nonce, uint32_t *last_nonce, uint32_t n) uint32_t max_nonce, uint32_t *last_nonce, uint32_t n)
{ {
uint32_t *nonce = (uint32_t *)(pdata + 76); uint32_t *nonce = (uint32_t *)(pdata + 76);
char *scratchbuf;
uint32_t data[20]; uint32_t data[20];
uint32_t tmp_hash7; uint32_t tmp_hash7;
uint32_t Htarg = le32toh(((const uint32_t *)ptarget)[7]); uint32_t Htarg = le32toh(((const uint32_t *)ptarget)[7]);

22
driver-opencl.c

@ -169,10 +169,11 @@ char *set_lookup_gap(char *arg)
return NULL; return NULL;
} }
char *set_thread_concurrency(char *arg) char *set_thread_concurrency(const char *_arg)
{ {
int i, val = 0, device = 0; int i, val = 0, device = 0;
char *nextptr; char *nextptr;
char *arg = strdupa(_arg);
nextptr = strtok(arg, ","); nextptr = strtok(arg, ",");
if (nextptr == NULL) if (nextptr == NULL)
@ -225,10 +226,11 @@ char *set_gpu_map(char *arg)
return NULL; return NULL;
} }
char *set_gpu_threads(char *arg) char *set_gpu_threads(const char *_arg)
{ {
int i, val = 1, device = 0; int i, val = 1, device = 0;
char *nextptr; char *nextptr;
char *arg = strdupa(_arg);
nextptr = strtok(arg, ","); nextptr = strtok(arg, ",");
if (nextptr == NULL) if (nextptr == NULL)
@ -254,10 +256,11 @@ char *set_gpu_threads(char *arg)
return NULL; return NULL;
} }
char *set_gpu_engine(char *arg) char *set_gpu_engine(const char *_arg)
{ {
int i, val1 = 0, val2 = 0, device = 0; int i, val1 = 0, val2 = 0, device = 0;
char *nextptr; char *nextptr;
char *arg = strdupa(_arg);
nextptr = strtok(arg, ","); nextptr = strtok(arg, ",");
if (nextptr == NULL) if (nextptr == NULL)
@ -325,10 +328,11 @@ char *set_gpu_fan(char *arg)
return NULL; return NULL;
} }
char *set_gpu_memclock(char *arg) char *set_gpu_memclock(const char *_arg)
{ {
int i, val = 0, device = 0; int i, val = 0, device = 0;
char *nextptr; char *nextptr;
char *arg = strdupa(_arg);
nextptr = strtok(arg, ","); nextptr = strtok(arg, ",");
if (nextptr == NULL) if (nextptr == NULL)
@ -509,10 +513,11 @@ char *set_temp_target(char *arg)
} }
#endif #endif
char *set_intensity(char *arg) char *set_intensity(const char *_arg)
{ {
int i, device = 0, *tt; int i, device = 0, *tt;
char *nextptr, val = 0; char *nextptr, val = 0;
char *arg = strdupa(_arg);
nextptr = strtok(arg, ","); nextptr = strtok(arg, ",");
if (nextptr == NULL) if (nextptr == NULL)
@ -562,10 +567,11 @@ char *set_intensity(char *arg)
return NULL; return NULL;
} }
char *set_xintensity(char *arg) char *set_xintensity(const char *_arg)
{ {
int i, device = 0, val = 0; int i, device = 0, val = 0;
char *nextptr; char *nextptr;
char *arg = strdupa(_arg);
nextptr = strtok(arg, ","); nextptr = strtok(arg, ",");
if (nextptr == NULL) if (nextptr == NULL)
@ -603,10 +609,11 @@ char *set_xintensity(char *arg)
return NULL; return NULL;
} }
char *set_rawintensity(char *arg) char *set_rawintensity(const char *_arg)
{ {
int i, device = 0, val = 0; int i, device = 0, val = 0;
char *nextptr; char *nextptr;
char *arg = strdupa(_arg);
nextptr = strtok(arg, ","); nextptr = strtok(arg, ",");
if (nextptr == NULL) if (nextptr == NULL)
@ -1403,7 +1410,6 @@ static void opencl_thread_shutdown(struct thr_info *thr)
{ {
const int thr_id = thr->id; const int thr_id = thr->id;
_clState *clState = clStates[thr_id]; _clState *clState = clStates[thr_id];
cl_kernel *kernel = clState->extra_kernels;
clStates[thr_id] = NULL; clStates[thr_id] = NULL;
unsigned int i; unsigned int i;

14
driver-opencl.h

@ -7,23 +7,23 @@
extern void print_ndevs(int *ndevs); extern void print_ndevs(int *ndevs);
extern void *reinit_gpu(void *userdata); extern void *reinit_gpu(void *userdata);
extern char *set_gpu_map(char *arg); extern char *set_gpu_map(char *arg);
extern char *set_gpu_threads(char *arg); extern char *set_gpu_threads(const char *arg);
extern char *set_gpu_engine(char *arg); extern char *set_gpu_engine(const char *arg);
extern char *set_gpu_fan(char *arg); extern char *set_gpu_fan(char *arg);
extern char *set_gpu_memclock(char *arg); extern char *set_gpu_memclock(const char *arg);
extern char *set_gpu_memdiff(char *arg); extern char *set_gpu_memdiff(char *arg);
extern char *set_gpu_powertune(char *arg); extern char *set_gpu_powertune(char *arg);
extern char *set_gpu_vddc(char *arg); extern char *set_gpu_vddc(char *arg);
extern char *set_temp_overheat(char *arg); extern char *set_temp_overheat(char *arg);
extern char *set_temp_target(char *arg); extern char *set_temp_target(char *arg);
extern char *set_intensity(char *arg); extern char *set_intensity(const char *arg);
extern char *set_xintensity(char *arg); extern char *set_xintensity(const char *arg);
extern char *set_rawintensity(char *arg); extern char *set_rawintensity(const char *arg);
extern char *set_vector(char *arg); extern char *set_vector(char *arg);
extern char *set_worksize(char *arg); extern char *set_worksize(char *arg);
extern char *set_shaders(char *arg); extern char *set_shaders(char *arg);
extern char *set_lookup_gap(char *arg); extern char *set_lookup_gap(char *arg);
extern char *set_thread_concurrency(char *arg); extern char *set_thread_concurrency(const char *arg);
void manage_gpu(void); void manage_gpu(void);
extern void pause_dynamic_threads(int gpu); extern void pause_dynamic_threads(int gpu);

4
fuguecoin.c

@ -63,11 +63,9 @@ int fuguecoin_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t
{ {
uint32_t tmp_hash7, Htarg = le32toh(((const uint32_t *)ptarget)[7]); uint32_t tmp_hash7, Htarg = le32toh(((const uint32_t *)ptarget)[7]);
uint32_t data[20], ohash[8]; uint32_t data[20], ohash[8];
//char *scratchbuf;
be32enc_vect(data, (const uint32_t *)pdata, 19); be32enc_vect(data, (const uint32_t *)pdata, 19);
data[19] = htobe32(nonce); data[19] = htobe32(nonce);
//scratchbuf = alloca(SCRATCHBUF_SIZE);
fuguehash(ohash, data); fuguehash(ohash, data);
tmp_hash7 = be32toh(ohash[7]); tmp_hash7 = be32toh(ohash[7]);
@ -85,7 +83,6 @@ int fuguecoin_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t
void fuguecoin_regenhash(struct work *work) void fuguecoin_regenhash(struct work *work)
{ {
uint32_t data[20]; uint32_t data[20];
char *scratchbuf;
uint32_t *nonce = (uint32_t *)(work->data + 76); uint32_t *nonce = (uint32_t *)(work->data + 76);
uint32_t *ohash = (uint32_t *)(work->hash); uint32_t *ohash = (uint32_t *)(work->hash);
@ -100,7 +97,6 @@ bool scanhash_fuguecoin(struct thr_info *thr, const unsigned char __maybe_unused
uint32_t max_nonce, uint32_t *last_nonce, uint32_t n) uint32_t max_nonce, uint32_t *last_nonce, uint32_t n)
{ {
uint32_t *nonce = (uint32_t *)(pdata + 76); uint32_t *nonce = (uint32_t *)(pdata + 76);
char *scratchbuf;
uint32_t data[20]; uint32_t data[20];
uint32_t tmp_hash7; uint32_t tmp_hash7;
uint32_t Htarg = le32toh(((const uint32_t *)ptarget)[7]); uint32_t Htarg = le32toh(((const uint32_t *)ptarget)[7]);

5
groestlcoin.c

@ -54,7 +54,6 @@ be32enc_vect(uint32_t *dst, const uint32_t *src, uint32_t len)
inline void groestlhash(void *state, const void *input) inline void groestlhash(void *state, const void *input)
{ {
sph_groestl512_context ctx_groestl; sph_groestl512_context ctx_groestl;
sph_sha256_context ctx_sha2;
uint32_t hash[16]; uint32_t hash[16];
@ -77,11 +76,9 @@ int groestlcoin_test(unsigned char *pdata, const unsigned char *ptarget, uint32_
{ {
uint32_t tmp_hash7, Htarg = le32toh(((const uint32_t *)ptarget)[7]); uint32_t tmp_hash7, Htarg = le32toh(((const uint32_t *)ptarget)[7]);
uint32_t data[20], ohash[8]; uint32_t data[20], ohash[8];
//char *scratchbuf;
be32enc_vect(data, (const uint32_t *)pdata, 19); be32enc_vect(data, (const uint32_t *)pdata, 19);
data[19] = htobe32(nonce); data[19] = htobe32(nonce);
//scratchbuf = alloca(SCRATCHBUF_SIZE);
groestlhash(ohash, data); groestlhash(ohash, data);
tmp_hash7 = be32toh(ohash[7]); tmp_hash7 = be32toh(ohash[7]);
@ -99,7 +96,6 @@ int groestlcoin_test(unsigned char *pdata, const unsigned char *ptarget, uint32_
void groestlcoin_regenhash(struct work *work) void groestlcoin_regenhash(struct work *work)
{ {
uint32_t data[20]; uint32_t data[20];
char *scratchbuf;
uint32_t *nonce = (uint32_t *)(work->data + 76); uint32_t *nonce = (uint32_t *)(work->data + 76);
uint32_t *ohash = (uint32_t *)(work->hash); uint32_t *ohash = (uint32_t *)(work->hash);
@ -114,7 +110,6 @@ bool scanhash_groestlcoin(struct thr_info *thr, const unsigned char __maybe_unus
uint32_t max_nonce, uint32_t *last_nonce, uint32_t n) uint32_t max_nonce, uint32_t *last_nonce, uint32_t n)
{ {
uint32_t *nonce = (uint32_t *)(pdata + 76); uint32_t *nonce = (uint32_t *)(pdata + 76);
char *scratchbuf;
uint32_t data[20]; uint32_t data[20];
uint32_t tmp_hash7; uint32_t tmp_hash7;
uint32_t Htarg = le32toh(((const uint32_t *)ptarget)[7]); uint32_t Htarg = le32toh(((const uint32_t *)ptarget)[7]);

4
inkcoin.c

@ -114,11 +114,9 @@ int inkcoin_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t no
{ {
uint32_t tmp_hash7, Htarg = le32toh(((const uint32_t *)ptarget)[7]); uint32_t tmp_hash7, Htarg = le32toh(((const uint32_t *)ptarget)[7]);
uint32_t data[20], ohash[8]; uint32_t data[20], ohash[8];
//char *scratchbuf;
be32enc_vect(data, (const uint32_t *)pdata, 19); be32enc_vect(data, (const uint32_t *)pdata, 19);
data[19] = htobe32(nonce); data[19] = htobe32(nonce);
//scratchbuf = alloca(SCRATCHBUF_SIZE);
inkhash(ohash, data); inkhash(ohash, data);
tmp_hash7 = be32toh(ohash[7]); tmp_hash7 = be32toh(ohash[7]);
@ -136,7 +134,6 @@ int inkcoin_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t no
void inkcoin_regenhash(struct work *work) void inkcoin_regenhash(struct work *work)
{ {
uint32_t data[20]; uint32_t data[20];
char *scratchbuf;
uint32_t *nonce = (uint32_t *)(work->data + 76); uint32_t *nonce = (uint32_t *)(work->data + 76);
uint32_t *ohash = (uint32_t *)(work->hash); uint32_t *ohash = (uint32_t *)(work->hash);
@ -198,7 +195,6 @@ bool scanhash_inkcoin(struct thr_info *thr, const unsigned char __maybe_unused *
uint32_t max_nonce, uint32_t *last_nonce, uint32_t n) uint32_t max_nonce, uint32_t *last_nonce, uint32_t n)
{ {
uint32_t *nonce = (uint32_t *)(pdata + 76); uint32_t *nonce = (uint32_t *)(pdata + 76);
char *scratchbuf;
uint32_t data[20]; uint32_t data[20];
uint32_t tmp_hash7; uint32_t tmp_hash7;
uint32_t Htarg = le32toh(((const uint32_t *)ptarget)[7]); uint32_t Htarg = le32toh(((const uint32_t *)ptarget)[7]);

4
marucoin.c

@ -162,11 +162,9 @@ int marucoin_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t n
{ {
uint32_t tmp_hash7, Htarg = le32toh(((const uint32_t *)ptarget)[7]); uint32_t tmp_hash7, Htarg = le32toh(((const uint32_t *)ptarget)[7]);
uint32_t data[20], ohash[8]; uint32_t data[20], ohash[8];
//char *scratchbuf;
be32enc_vect(data, (const uint32_t *)pdata, 19); be32enc_vect(data, (const uint32_t *)pdata, 19);
data[19] = htobe32(nonce); data[19] = htobe32(nonce);
//scratchbuf = alloca(SCRATCHBUF_SIZE);
maruhash(ohash, data); maruhash(ohash, data);
tmp_hash7 = be32toh(ohash[7]); tmp_hash7 = be32toh(ohash[7]);
@ -184,7 +182,6 @@ int marucoin_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t n
void marucoin_regenhash(struct work *work) void marucoin_regenhash(struct work *work)
{ {
uint32_t data[20]; uint32_t data[20];
char *scratchbuf;
uint32_t *nonce = (uint32_t *)(work->data + 76); uint32_t *nonce = (uint32_t *)(work->data + 76);
uint32_t *ohash = (uint32_t *)(work->hash); uint32_t *ohash = (uint32_t *)(work->hash);
@ -199,7 +196,6 @@ bool scanhash_marucoin(struct thr_info *thr, const unsigned char __maybe_unused
uint32_t max_nonce, uint32_t *last_nonce, uint32_t n) uint32_t max_nonce, uint32_t *last_nonce, uint32_t n)
{ {
uint32_t *nonce = (uint32_t *)(pdata + 76); uint32_t *nonce = (uint32_t *)(pdata + 76);
char *scratchbuf;
uint32_t data[20]; uint32_t data[20];
uint32_t tmp_hash7; uint32_t tmp_hash7;
uint32_t Htarg = le32toh(((const uint32_t *)ptarget)[7]); uint32_t Htarg = le32toh(((const uint32_t *)ptarget)[7]);

4
myriadcoin-groestl.c

@ -77,11 +77,9 @@ int myriadcoin_groestl_test(unsigned char *pdata, const unsigned char *ptarget,
{ {
uint32_t tmp_hash7, Htarg = le32toh(((const uint32_t *)ptarget)[7]); uint32_t tmp_hash7, Htarg = le32toh(((const uint32_t *)ptarget)[7]);
uint32_t data[20], ohash[8]; uint32_t data[20], ohash[8];
//char *scratchbuf;
be32enc_vect(data, (const uint32_t *)pdata, 19); be32enc_vect(data, (const uint32_t *)pdata, 19);
data[19] = htobe32(nonce); data[19] = htobe32(nonce);
//scratchbuf = alloca(SCRATCHBUF_SIZE);
mghash(ohash, data); mghash(ohash, data);
tmp_hash7 = be32toh(ohash[7]); tmp_hash7 = be32toh(ohash[7]);
@ -99,7 +97,6 @@ int myriadcoin_groestl_test(unsigned char *pdata, const unsigned char *ptarget,
void myriadcoin_groestl_regenhash(struct work *work) void myriadcoin_groestl_regenhash(struct work *work)
{ {
uint32_t data[20]; uint32_t data[20];
char *scratchbuf;
uint32_t *nonce = (uint32_t *)(work->data + 76); uint32_t *nonce = (uint32_t *)(work->data + 76);
uint32_t *ohash = (uint32_t *)(work->hash); uint32_t *ohash = (uint32_t *)(work->hash);
@ -114,7 +111,6 @@ bool scanhash_myriadcoin_groestl(struct thr_info *thr, const unsigned char __may
uint32_t max_nonce, uint32_t *last_nonce, uint32_t n) uint32_t max_nonce, uint32_t *last_nonce, uint32_t n)
{ {
uint32_t *nonce = (uint32_t *)(pdata + 76); uint32_t *nonce = (uint32_t *)(pdata + 76);
char *scratchbuf;
uint32_t data[20]; uint32_t data[20];
uint32_t tmp_hash7; uint32_t tmp_hash7;
uint32_t Htarg = le32toh(((const uint32_t *)ptarget)[7]); uint32_t Htarg = le32toh(((const uint32_t *)ptarget)[7]);

4
quarkcoin.c

@ -149,11 +149,9 @@ int quarkcoin_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t
{ {
uint32_t tmp_hash7, Htarg = le32toh(((const uint32_t *)ptarget)[7]); uint32_t tmp_hash7, Htarg = le32toh(((const uint32_t *)ptarget)[7]);
uint32_t data[20], ohash[8]; uint32_t data[20], ohash[8];
//char *scratchbuf;
be32enc_vect(data, (const uint32_t *)pdata, 19); be32enc_vect(data, (const uint32_t *)pdata, 19);
data[19] = htobe32(nonce); data[19] = htobe32(nonce);
//scratchbuf = alloca(SCRATCHBUF_SIZE);
quarkhash(ohash, data); quarkhash(ohash, data);
tmp_hash7 = be32toh(ohash[7]); tmp_hash7 = be32toh(ohash[7]);
@ -171,7 +169,6 @@ int quarkcoin_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t
void quarkcoin_regenhash(struct work *work) void quarkcoin_regenhash(struct work *work)
{ {
uint32_t data[20]; uint32_t data[20];
char *scratchbuf;
uint32_t *nonce = (uint32_t *)(work->data + 76); uint32_t *nonce = (uint32_t *)(work->data + 76);
uint32_t *ohash = (uint32_t *)(work->hash); uint32_t *ohash = (uint32_t *)(work->hash);
@ -186,7 +183,6 @@ bool scanhash_quarkcoin(struct thr_info *thr, const unsigned char __maybe_unused
uint32_t max_nonce, uint32_t *last_nonce, uint32_t n) uint32_t max_nonce, uint32_t *last_nonce, uint32_t n)
{ {
uint32_t *nonce = (uint32_t *)(pdata + 76); uint32_t *nonce = (uint32_t *)(pdata + 76);
char *scratchbuf;
uint32_t data[20]; uint32_t data[20];
uint32_t tmp_hash7; uint32_t tmp_hash7;
uint32_t Htarg = le32toh(((const uint32_t *)ptarget)[7]); uint32_t Htarg = le32toh(((const uint32_t *)ptarget)[7]);

4
qubitcoin.c

@ -113,11 +113,9 @@ int qubitcoin_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t
{ {
uint32_t tmp_hash7, Htarg = le32toh(((const uint32_t *)ptarget)[7]); uint32_t tmp_hash7, Htarg = le32toh(((const uint32_t *)ptarget)[7]);
uint32_t data[20], ohash[8]; uint32_t data[20], ohash[8];
//char *scratchbuf;
be32enc_vect(data, (const uint32_t *)pdata, 19); be32enc_vect(data, (const uint32_t *)pdata, 19);
data[19] = htobe32(nonce); data[19] = htobe32(nonce);
//scratchbuf = alloca(SCRATCHBUF_SIZE);
qhash(ohash, data); qhash(ohash, data);
tmp_hash7 = be32toh(ohash[7]); tmp_hash7 = be32toh(ohash[7]);
@ -135,7 +133,6 @@ int qubitcoin_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t
void qubitcoin_regenhash(struct work *work) void qubitcoin_regenhash(struct work *work)
{ {
uint32_t data[20]; uint32_t data[20];
char *scratchbuf;
uint32_t *nonce = (uint32_t *)(work->data + 76); uint32_t *nonce = (uint32_t *)(work->data + 76);
uint32_t *ohash = (uint32_t *)(work->hash); uint32_t *ohash = (uint32_t *)(work->hash);
@ -150,7 +147,6 @@ bool scanhash_qubitcoin(struct thr_info *thr, const unsigned char __maybe_unused
uint32_t max_nonce, uint32_t *last_nonce, uint32_t n) uint32_t max_nonce, uint32_t *last_nonce, uint32_t n)
{ {
uint32_t *nonce = (uint32_t *)(pdata + 76); uint32_t *nonce = (uint32_t *)(pdata + 76);
char *scratchbuf;
uint32_t data[20]; uint32_t data[20];
uint32_t tmp_hash7; uint32_t tmp_hash7;
uint32_t Htarg = le32toh(((const uint32_t *)ptarget)[7]); uint32_t Htarg = le32toh(((const uint32_t *)ptarget)[7]);

14
sgminer.c

@ -1190,11 +1190,10 @@ static char *set_null(const char __maybe_unused *arg)
char *set_difficulty_multiplier(char *arg) char *set_difficulty_multiplier(char *arg)
{ {
char **endptr = NULL;
if (!(arg && arg[0])) if (!(arg && arg[0]))
return "Invalid parameters for set difficulty multiplier"; return "Invalid parameters for set difficulty multiplier";
opt_diff_mult = strtod(arg, endptr); opt_diff_mult = strtod(arg, NULL);
if (opt_diff_mult == 0 || endptr == arg) if (opt_diff_mult == 0.0)
return "Invalid value passed to set difficulty multiplier"; return "Invalid value passed to set difficulty multiplier";
return NULL; return NULL;
@ -3352,7 +3351,7 @@ static
#ifdef WIN32 #ifdef WIN32
const const
#endif #endif
char **initial_args; const char **initial_args;
static void clean_up(bool restarting); static void clean_up(bool restarting);
@ -6225,7 +6224,7 @@ static void get_work_prepare_thread(struct thr_info *mythr, struct work *work)
for (i = 0; i < total_devices; ++i) for (i = 0; i < total_devices; ++i)
n_threads += devices[i]->threads; n_threads += devices[i]->threads;
if (unlikely(pthread_create(&restart_thr, NULL, restart_mining_threads_thread, n_threads))) if (unlikely(pthread_create(&restart_thr, NULL, restart_mining_threads_thread, (void *)n_threads)))
quit(1, "restart_mining_threads create thread failed"); quit(1, "restart_mining_threads create thread failed");
sleep(60); sleep(60);
quit(1, "thread was not cancelled in 60 seconds after restart_mining_threads"); quit(1, "thread was not cancelled in 60 seconds after restart_mining_threads");
@ -8143,8 +8142,7 @@ int main(int argc, char *argv[])
#endif #endif
struct thr_info *thr; struct thr_info *thr;
struct block *block; struct block *block;
unsigned int k; int i;
int i, j;
char *s; char *s;
/* This dangerous function tramples random dynamically allocated /* This dangerous function tramples random dynamically allocated
@ -8160,7 +8158,7 @@ int main(int argc, char *argv[])
initial_args = (const char **)malloc(sizeof(char *)* (argc + 1)); initial_args = (const char **)malloc(sizeof(char *)* (argc + 1));
for (i = 0; i < argc; i++) for (i = 0; i < argc; i++)
initial_args[i] = strdup(argv[i]); initial_args[i] = (const char *)strdup(argv[i]);
initial_args[argc] = NULL; initial_args[argc] = NULL;
mutex_init(&hash_lock); mutex_init(&hash_lock);

4
sifcoin.c

@ -104,11 +104,9 @@ int sifcoin_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t no
{ {
uint32_t tmp_hash7, Htarg = le32toh(((const uint32_t *)ptarget)[7]); uint32_t tmp_hash7, Htarg = le32toh(((const uint32_t *)ptarget)[7]);
uint32_t data[20], ohash[8]; uint32_t data[20], ohash[8];
//char *scratchbuf;
be32enc_vect(data, (const uint32_t *)pdata, 19); be32enc_vect(data, (const uint32_t *)pdata, 19);
data[19] = htobe32(nonce); data[19] = htobe32(nonce);
//scratchbuf = alloca(SCRATCHBUF_SIZE);
sifhash(ohash, data); sifhash(ohash, data);
tmp_hash7 = be32toh(ohash[7]); tmp_hash7 = be32toh(ohash[7]);
@ -126,7 +124,6 @@ int sifcoin_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t no
void sifcoin_regenhash(struct work *work) void sifcoin_regenhash(struct work *work)
{ {
uint32_t data[20]; uint32_t data[20];
char *scratchbuf;
uint32_t *nonce = (uint32_t *)(work->data + 76); uint32_t *nonce = (uint32_t *)(work->data + 76);
uint32_t *ohash = (uint32_t *)(work->hash); uint32_t *ohash = (uint32_t *)(work->hash);
@ -141,7 +138,6 @@ bool scanhash_sifcoin(struct thr_info *thr, const unsigned char __maybe_unused *
uint32_t max_nonce, uint32_t *last_nonce, uint32_t n) uint32_t max_nonce, uint32_t *last_nonce, uint32_t n)
{ {
uint32_t *nonce = (uint32_t *)(pdata + 76); uint32_t *nonce = (uint32_t *)(pdata + 76);
char *scratchbuf;
uint32_t data[20]; uint32_t data[20];
uint32_t tmp_hash7; uint32_t tmp_hash7;
uint32_t Htarg = le32toh(((const uint32_t *)ptarget)[7]); uint32_t Htarg = le32toh(((const uint32_t *)ptarget)[7]);

4
twecoin.c

@ -90,11 +90,9 @@ int twecoin_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t no
{ {
uint32_t tmp_hash7, Htarg = le32toh(((const uint32_t *)ptarget)[7]); uint32_t tmp_hash7, Htarg = le32toh(((const uint32_t *)ptarget)[7]);
uint32_t data[20], ohash[8]; uint32_t data[20], ohash[8];
//char *scratchbuf;
be32enc_vect(data, (const uint32_t *)pdata, 19); be32enc_vect(data, (const uint32_t *)pdata, 19);
data[19] = htobe32(nonce); data[19] = htobe32(nonce);
//scratchbuf = alloca(SCRATCHBUF_SIZE);
twehash(ohash, data); twehash(ohash, data);
tmp_hash7 = be32toh(ohash[7]); tmp_hash7 = be32toh(ohash[7]);
@ -112,7 +110,6 @@ int twecoin_test(unsigned char *pdata, const unsigned char *ptarget, uint32_t no
void twecoin_regenhash(struct work *work) void twecoin_regenhash(struct work *work)
{ {
uint32_t data[20]; uint32_t data[20];
char *scratchbuf;
uint32_t *nonce = (uint32_t *)(work->data + 76); uint32_t *nonce = (uint32_t *)(work->data + 76);
uint32_t *ohash = (uint32_t *)(work->hash); uint32_t *ohash = (uint32_t *)(work->hash);
@ -127,7 +124,6 @@ bool scanhash_twecoin(struct thr_info *thr, const unsigned char __maybe_unused *
uint32_t max_nonce, uint32_t *last_nonce, uint32_t n) uint32_t max_nonce, uint32_t *last_nonce, uint32_t n)
{ {
uint32_t *nonce = (uint32_t *)(pdata + 76); uint32_t *nonce = (uint32_t *)(pdata + 76);
char *scratchbuf;
uint32_t data[20]; uint32_t data[20];
uint32_t tmp_hash7; uint32_t tmp_hash7;
uint32_t Htarg = le32toh(((const uint32_t *)ptarget)[7]); uint32_t Htarg = le32toh(((const uint32_t *)ptarget)[7]);

2
util.c

@ -1671,7 +1671,7 @@ static bool parse_diff(struct pool *pool, json_t *val)
static bool parse_extranonce(struct pool *pool, json_t *val) static bool parse_extranonce(struct pool *pool, json_t *val)
{ {
char s[RBUFSIZE], *nonce1; char *nonce1;
int n2size; int n2size;
nonce1 = json_array_string(val, 0); nonce1 = json_array_string(val, 0);

1
util.h

@ -137,6 +137,7 @@ char *recv_line(struct pool *pool);
bool parse_method(struct pool *pool, char *s); bool parse_method(struct pool *pool, char *s);
bool extract_sockaddr(char *url, char **sockaddr_url, char **sockaddr_port); bool extract_sockaddr(char *url, char **sockaddr_url, char **sockaddr_port);
bool auth_stratum(struct pool *pool); bool auth_stratum(struct pool *pool);
bool subscribe_extranonce(struct pool *pool);
bool initiate_stratum(struct pool *pool); bool initiate_stratum(struct pool *pool);
bool restart_stratum(struct pool *pool); bool restart_stratum(struct pool *pool);
void suspend_stratum(struct pool *pool); void suspend_stratum(struct pool *pool);

Loading…
Cancel
Save