From c603ab29a4e9b52c14c7972114f98669d7b4e2bd Mon Sep 17 00:00:00 2001 From: kanoi Date: Thu, 7 Jan 2016 17:01:52 +1100 Subject: [PATCH 1/2] php - workers all array can be shorter than the original --- pool/page_workers.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/pool/page_workers.php b/pool/page_workers.php index 0f9c197b..912b8214 100644 --- a/pool/page_workers.php +++ b/pool/page_workers.php @@ -98,13 +98,13 @@ function workuser($data, $user, &$offset, &$totshare, &$totdiff, if ($srt) usort($all, 'workhashorder'); - for ($i = 0; $i < $count; $i++) + foreach ($all as $arow) { - $lst = $now - $all[$i]['w_lastshare']; + $lst = $now - $arow['w_lastshare']; if ($old !== false && $lst > $old) continue; - $lstacc = $now - $all[$i]['w_lastshareacc']; + $lstacc = $now - $arow['w_lastshareacc']; if ((($offset) % 2) == 0) $row = 'even'; @@ -112,18 +112,18 @@ function workuser($data, $user, &$offset, &$totshare, &$totdiff, $row = 'odd'; $pg .= ""; - $pg .= ''.htmlspecialchars($all[$i]['workername']).''; - if ($all[$i]['w_lastdiff'] > 0) - $ld = difffmt($all[$i]['w_lastdiff']); + $pg .= ''.htmlspecialchars($arow['workername']).''; + if ($arow['w_lastdiff'] > 0) + $ld = difffmt($arow['w_lastdiff']); else $ld = ' '; $pg .= "$ld"; $pg .= "".howlongago($lstacc).''; - $shareacc = number_format($all[$i]['w_shareacc'], 0); - $totshare += $all[$i]['w_shareacc']; - $dacc = $all[$i]['w_diffacc']; + $shareacc = number_format($arow['w_shareacc'], 0); + $totshare += $arow['w_shareacc']; + $dacc = $arow['w_diffacc']; $diffacc = number_format($dacc, 0); $ds = round($dacc); $totdiff += $dacc; @@ -132,7 +132,7 @@ function workuser($data, $user, &$offset, &$totshare, &$totdiff, $acthr = '0'; $acthrv = 0; - $actstt = $all[$i]['w_active_start']; + $actstt = $arow['w_active_start']; if ($actstt <= 0 || ($now - $actstt) < 0) $actsin = ' '; else @@ -141,7 +141,7 @@ function workuser($data, $user, &$offset, &$totshare, &$totdiff, $elapsed = $now - $actstt; if ($elapsed > 0) { - $acthrv = $all[$i]['w_active_diffacc'] * + $acthrv = $arow['w_active_diffacc'] * pow(2,32) / $elapsed; $acthr = dsprate($acthrv); $totshrate += $acthrv; @@ -150,7 +150,7 @@ function workuser($data, $user, &$offset, &$totshare, &$totdiff, $pg .= "$acthr"; $pg .= "$actsin"; - $dinv = $all[$i]['w_diffinv']; + $dinv = $arow['w_diffinv']; $dtot = $dacc + $dinv; if ($dtot > 0) { @@ -168,8 +168,8 @@ function workuser($data, $user, &$offset, &$totshare, &$totdiff, foreach(array('sta','dup','hi','rej') as $fld) { - $shr = number_format($all[$i]['w_share'.$fld]); - $dif = $all[$i]['w_diff'.$fld]; + $shr = number_format($arow['w_share'.$fld]); + $dif = $arow['w_diff'.$fld]; $ddif = number_format($dif); $sdif = number_format($dif,0,'',''); $pg .= "$ddif/$shr"; @@ -182,7 +182,7 @@ function workuser($data, $user, &$offset, &$totshare, &$totdiff, $pg .= "$blkpct"; - $uhr = $all[$i]['w_uhr']; + $uhr = $arow['w_uhr']; if ($uhr == '?') { $uhr = '?GHs'; From 482858b1c3a59521b26f7f309b3353c554e7aa76 Mon Sep 17 00:00:00 2001 From: kanoi Date: Thu, 7 Jan 2016 17:22:24 +1100 Subject: [PATCH 2/2] ckdb - update version for library changes --- src/ckdb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ckdb.h b/src/ckdb.h index 9466b669..68bc6f5c 100644 --- a/src/ckdb.h +++ b/src/ckdb.h @@ -51,7 +51,7 @@ #define DB_VLOCK "1" #define DB_VERSION "1.0.4" -#define CKDB_VERSION DB_VERSION"-1.911" +#define CKDB_VERSION DB_VERSION"-1.912" #define WHERE_FFL " - from %s %s() line %d" #define WHERE_FFL_HERE __FILE__, __func__, __LINE__