Commit 4a4985d5 authored by Volker Lendecke's avatar Volker Lendecke Committed by Rusty Russell

tally: Adapt divlu64 to Samba coding conventions

(Imported from SAMBA commit ee91004f4bddcda873f8ccde1db16609a66a493b)
parent 137c60bf
......@@ -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. */
......
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