Browse Source

fix some warnings... seen in vstudio...

2upstream
Tanguy Pruvot 10 years ago
parent
commit
0ab02df9e2
  1. 13
      JHA/jackpotcoin.cu
  2. 4
      stats.cpp

13
JHA/jackpotcoin.cu

@ -207,21 +207,20 @@ extern "C" int scanhash_jackpot(int thr_id, uint32_t *pdata,
quark_jh512_cpu_hash_64(thr_id, nrm2, pdata[19], d_branch2Nonces[thr_id], d_hash[thr_id], order++); quark_jh512_cpu_hash_64(thr_id, nrm2, pdata[19], d_branch2Nonces[thr_id], d_hash[thr_id], order++);
} }
*hashes_done = pdata[19] - first_nonce + throughput;
uint32_t foundNonce = cuda_check_hash_branch(thr_id, nrm3, pdata[19], d_branch3Nonces[thr_id], d_hash[thr_id], order++); uint32_t foundNonce = cuda_check_hash_branch(thr_id, nrm3, pdata[19], d_branch3Nonces[thr_id], d_hash[thr_id], order++);
if (foundNonce != 0xffffffff) if (foundNonce != 0xffffffff)
{ {
unsigned int rounds;
uint32_t vhash64[8]; uint32_t vhash64[8];
uint32_t Htarg = ptarget[7];
be32enc(&endiandata[19], foundNonce); be32enc(&endiandata[19], foundNonce);
// diese jackpothash Funktion gibt die Zahl der Runden zurück // diese jackpothash Funktion gibt die Zahl der Runden zurück
rounds = jackpothash(vhash64, endiandata); jackpothash(vhash64, endiandata);
if (vhash64[7] <= Htarg && fulltest(vhash64, ptarget)) { if (vhash64[7] <= ptarget[7] && fulltest(vhash64, ptarget)) {
int res = 1; int res = 1;
uint32_t secNonce = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); uint32_t secNonce = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1);
*hashes_done = pdata[19] - first_nonce + throughput;
if (secNonce != 0) { if (secNonce != 0) {
pdata[21] = secNonce; pdata[21] = secNonce;
res++; res++;
@ -234,7 +233,8 @@ extern "C" int scanhash_jackpot(int thr_id, uint32_t *pdata,
} }
} }
if ((uint64_t) pdata[19] + throughput > (uint64_t) max_nonce) { if ((uint64_t) pdata[19] + throughput > max_nonce) {
*hashes_done = pdata[19] - first_nonce;
pdata[19] = max_nonce; pdata[19] = max_nonce;
break; break;
} }
@ -243,6 +243,5 @@ extern "C" int scanhash_jackpot(int thr_id, uint32_t *pdata,
} while (!work_restart[thr_id].restart); } while (!work_restart[thr_id].restart);
*hashes_done = pdata[19] - first_nonce + 1;
return 0; return 0;
} }

4
stats.cpp

@ -37,8 +37,8 @@ void stats_remember_speed(int thr_id, uint32_t hashcount, double hashrate, uint8
memset(&data, 0, sizeof(data)); memset(&data, 0, sizeof(data));
data.uid = (uint32_t) uid; data.uid = (uint32_t) uid;
data.gpu_id = device_map[thr_id]; data.gpu_id = (uint8_t) device_map[thr_id];
data.thr_id = (uint8_t)thr_id; data.thr_id = (uint8_t) thr_id;
data.tm_stat = (uint32_t) time(NULL); data.tm_stat = (uint32_t) time(NULL);
data.height = height; data.height = height;
data.hashcount = hashcount; data.hashcount = hashcount;

Loading…
Cancel
Save