From 0ab02df9e296f0fbccd7f9dd08d80d0508d191c9 Mon Sep 17 00:00:00 2001 From: Tanguy Pruvot Date: Fri, 15 May 2015 00:14:36 +0200 Subject: [PATCH] fix some warnings... seen in vstudio... --- JHA/jackpotcoin.cu | 13 ++++++------- stats.cpp | 4 ++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/JHA/jackpotcoin.cu b/JHA/jackpotcoin.cu index 50b9c0b..1194c68 100644 --- a/JHA/jackpotcoin.cu +++ b/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++); } + *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++); if (foundNonce != 0xffffffff) { - unsigned int rounds; uint32_t vhash64[8]; - uint32_t Htarg = ptarget[7]; be32enc(&endiandata[19], foundNonce); // 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; 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) { pdata[21] = secNonce; 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; break; } @@ -243,6 +243,5 @@ extern "C" int scanhash_jackpot(int thr_id, uint32_t *pdata, } while (!work_restart[thr_id].restart); - *hashes_done = pdata[19] - first_nonce + 1; return 0; } diff --git a/stats.cpp b/stats.cpp index 090c19b..3aa8aea 100644 --- a/stats.cpp +++ b/stats.cpp @@ -37,8 +37,8 @@ void stats_remember_speed(int thr_id, uint32_t hashcount, double hashrate, uint8 memset(&data, 0, sizeof(data)); data.uid = (uint32_t) uid; - data.gpu_id = device_map[thr_id]; - data.thr_id = (uint8_t)thr_id; + data.gpu_id = (uint8_t) device_map[thr_id]; + data.thr_id = (uint8_t) thr_id; data.tm_stat = (uint32_t) time(NULL); data.height = height; data.hashcount = hashcount;