summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-08-10 19:49:55 +0200
committerVolker Lendecke <vl@samba.org>2011-08-10 19:56:11 +0200
commitee91004f4bddcda873f8ccde1db16609a66a493b (patch)
treec96255cd937db64b7a92e033a3332bd58da9f845
parent26795b3dd1a90c61424cd8f1761f98bc60b3ddc4 (diff)
downloadsamba-ee91004f4bddcda873f8ccde1db16609a66a493b.tar.gz
samba-ee91004f4bddcda873f8ccde1db16609a66a493b.tar.bz2
samba-ee91004f4bddcda873f8ccde1db16609a66a493b.zip
Adapt divlu64 to Samba coding conventions
-rw-r--r--lib/ccan/tally/tally.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/ccan/tally/tally.c b/lib/ccan/tally/tally.c
index a6d66b6688..d9f30ba12f 100644
--- a/lib/ccan/tally/tally.c
+++ b/lib/ccan/tally/tally.c
@@ -231,8 +231,9 @@ static uint64_t divlu64(uint64_t u1, uint64_t u0, uint64_t v)
uint64_t p; /* Product of two digits. */
int64_t s, i, j, t, k;
- if (u1 >= v) /* If overflow, return the largest */
+ if (u1 >= v) { /* If overflow, return the largest */
return (uint64_t)-1; /* possible quotient. */
+ }
s = 64 - fls64(v); /* 0 <= s <= 63. */
vn0 = v << s; /* Normalize divisor. */
@@ -255,7 +256,9 @@ static uint64_t divlu64(uint64_t u1, uint64_t u0, uint64_t v)
if (qhat >= b || qhat*vn[0] > b*rhat + un[j]) {
qhat = qhat - 1;
rhat = rhat + vn[1];
- if (rhat < b) goto again;
+ if (rhat < b) {
+ goto again;
+ }
}
/* Multiply and subtract. */