diff --git a/main.c b/main.c index 35657f71..be0d8b3e 100644 --- a/main.c +++ b/main.c @@ -408,11 +408,13 @@ static double bench_algo_stage3( struct timeval end; struct timeval start; - uint64_t hashes_done = 0; - uint32_t max_nonce = (1<<21); + uint32_t max_nonce = (1<<22); + unsigned long hashes_done = 0; gettimeofday(&start, 0); - #ifdef WANT_VIA_PADLOCK + #if defined(WANT_VIA_PADLOCK) + + // For some reason, the VIA padlock hasher has a different API ... if (ALGO_VIA==algo) { (void)scanhash_via( 0, @@ -424,20 +426,20 @@ static double bench_algo_stage3( ); } else #endif - { - sha256_func func = sha256_funcs[algo]; - (*func)( - 0, - work.midstate, - work.data + 64, - work.hash1, - work.hash, - work.target, - max_nonce, - &hashes_done, - work.blk.nonce - ); - } + { + sha256_func func = sha256_funcs[algo]; + (*func)( + 0, + work.midstate, + work.data + 64, + work.hash1, + work.hash, + work.target, + max_nonce, + &hashes_done, + work.blk.nonce + ); + } gettimeofday(&end, 0); work_restart = NULL; @@ -749,13 +751,29 @@ static void bench_algo( memset(name_spaces_pad, ' ', n); name_spaces_pad[n] = 0; - applog(LOG_ERR, "\"%s\"%s : benchmarking algorithm ...", algo_names[algo], name_spaces_pad); - double rate = bench_algo_stage2(algo); + applog( + LOG_ERR, + "\"%s\"%s : benchmarking algorithm ...", + algo_names[algo], + name_spaces_pad + ); + double rate = bench_algo_stage2(algo); if (rate<0.0) { - applog(LOG_ERR, "\"%s\"%s : algorithm fails on this platform", algo_names[algo], name_spaces_pad); + applog( + LOG_ERR, + "\"%s\"%s : algorithm fails on this platform", + algo_names[algo], + name_spaces_pad + ); } else { - applog(LOG_ERR, "\"%s\"%s : algorithm runs at %.5f MH/s", algo_names[algo], name_spaces_pad, rate); + applog( + LOG_ERR, + "\"%s\"%s : algorithm runs at %.5f MH/s", + algo_names[algo], + name_spaces_pad, + rate + ); if (*best_rate