Commit 252bd427 authored by Volker Lendecke's avatar Volker Lendecke Committed by Rusty Russell

tally: Adapt tally_add to Samba coding conventions

(Imported from SAMBA commit 9c32c86783bf6a3e126e6e83f51ccdf0ecdd132d)
parent e74c8a2b
......@@ -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)]++;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment