diff options
author | Volker Lendecke <vl@samba.org> | 2011-08-10 19:46:24 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2011-08-10 19:56:11 +0200 |
commit | 9c32c86783bf6a3e126e6e83f51ccdf0ecdd132d (patch) | |
tree | d982ffb61fac91ce4f61e78475c3c35336a43a6a /lib/ccan/tally | |
parent | 1fa4236c40a727d7ae648e12d14d1f0f9fcf79b5 (diff) | |
download | samba-9c32c86783bf6a3e126e6e83f51ccdf0ecdd132d.tar.gz samba-9c32c86783bf6a3e126e6e83f51ccdf0ecdd132d.tar.bz2 samba-9c32c86783bf6a3e126e6e83f51ccdf0ecdd132d.zip |
Adapt tally_add to Samba coding conventions
Diffstat (limited to 'lib/ccan/tally')
-rw-r--r-- | lib/ccan/tally/tally.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/ccan/tally/tally.c b/lib/ccan/tally/tally.c index 4c5e37e9e0..28a66a9f7f 100644 --- a/lib/ccan/tally/tally.c +++ b/lib/ccan/tally/tally.c @@ -138,15 +138,17 @@ void tally_add(struct tally *tally, ssize_t val) new_max = val; need_renormalize = true; } - if (need_renormalize) + if (need_renormalize) { renormalize(tally, new_min, new_max); + } /* 128-bit arithmetic! If we didn't want exact mean, we could just * pull it out of counts. */ - if (val > 0 && tally->total[0] + val < tally->total[0]) + if (val > 0 && tally->total[0] + val < tally->total[0]) { tally->total[1]++; - else if (val < 0 && tally->total[0] + val > tally->total[0]) + } else if (val < 0 && tally->total[0] + val > tally->total[0]) { tally->total[1]--; + } tally->total[0] += val; tally->counts[bucket_of(tally->min, tally->step_bits, val)]++; } |