Style changes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
diff --git a/cgminer.c b/cgminer.c
index f8c17a9..56496b2 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -4146,22 +4146,21 @@ void *miner_thread(void *userdata)
}
if (unlikely((long)sdiff.tv_sec < cycle)) {
+ int mult;
+
if (likely(!api->can_limit_work || max_nonce == 0xffffffff))
continue;
- {
- int mult = 1000000 / ((sdiff.tv_usec + 0x400) / 0x400) + 0x10;
- mult *= cycle;
- if (max_nonce > (0xffffffff * 0x400) / mult)
- max_nonce = 0xffffffff;
- else
- max_nonce = (max_nonce * mult) / 0x400;
- }
- } else if (unlikely(sdiff.tv_sec > cycle) && api->can_limit_work) {
+ mult = 1000000 / ((sdiff.tv_usec + 0x400) / 0x400) + 0x10;
+ mult *= cycle;
+ if (max_nonce > (0xffffffff * 0x400) / mult)
+ max_nonce = 0xffffffff;
+ else
+ max_nonce = (max_nonce * mult) / 0x400;
+ } else if (unlikely(sdiff.tv_sec > cycle) && api->can_limit_work)
max_nonce = max_nonce * cycle / sdiff.tv_sec;
- } else if (unlikely(sdiff.tv_usec > 100000) && api->can_limit_work) {
+ else if (unlikely(sdiff.tv_usec > 100000) && api->can_limit_work)
max_nonce = max_nonce * 0x400 / (((cycle * 1000000) + sdiff.tv_usec) / (cycle * 1000000 / 0x400));
- }
timersub(&tv_end, &tv_lastupdate, &diff);
if (diff.tv_sec >= opt_log_interval) {