mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-04 15:40:44 +00:00
divmoddi*: Use separate statements instead of the comma operator.
Differential Revision: https://reviews.freebsd.org/D40835
This commit is contained in:
parent
aa8567656e
commit
9ac841e922
|
@ -47,13 +47,17 @@ __divdi3(quad_t a, quad_t b)
|
|||
u_quad_t ua, ub, uq;
|
||||
int neg;
|
||||
|
||||
if (a < 0)
|
||||
ua = -(u_quad_t)a, neg = 1;
|
||||
else
|
||||
ua = a, neg = 0;
|
||||
if (b < 0)
|
||||
ub = -(u_quad_t)b, neg ^= 1;
|
||||
else
|
||||
if (a < 0) {
|
||||
ua = -(u_quad_t)a;
|
||||
neg = 1;
|
||||
} else {
|
||||
ua = a;
|
||||
neg = 0;
|
||||
}
|
||||
if (b < 0) {
|
||||
ub = -(u_quad_t)b;
|
||||
neg ^= 1;
|
||||
} else
|
||||
ub = b;
|
||||
uq = __qdivrem(ua, ub, (u_quad_t *)0);
|
||||
return (neg ? -uq : uq);
|
||||
|
|
|
@ -44,13 +44,19 @@ __divmoddi4(quad_t a, quad_t b, quad_t *rem)
|
|||
u_quad_t ua, ub, uq, urem;
|
||||
int negq, negr;
|
||||
|
||||
if (a < 0)
|
||||
ua = -(u_quad_t)a, negq = 1, negr = 1;
|
||||
else
|
||||
ua = a, negq = 0, negr = 0;
|
||||
if (b < 0)
|
||||
ub = -(u_quad_t)b, negq ^= 1;
|
||||
else
|
||||
if (a < 0) {
|
||||
ua = -(u_quad_t)a;
|
||||
negq = 1;
|
||||
negr = 1;
|
||||
} else {
|
||||
ua = a;
|
||||
negq = 0;
|
||||
negr = 0;
|
||||
}
|
||||
if (b < 0) {
|
||||
ub = -(u_quad_t)b;
|
||||
negq ^= 1;
|
||||
} else
|
||||
ub = b;
|
||||
uq = __qdivrem(ua, ub, &urem);
|
||||
if (rem != 0)
|
||||
|
|
|
@ -47,10 +47,13 @@ __moddi3(quad_t a, quad_t b)
|
|||
u_quad_t ua, ub, ur;
|
||||
int neg;
|
||||
|
||||
if (a < 0)
|
||||
ua = -(u_quad_t)a, neg = 1;
|
||||
else
|
||||
ua = a, neg = 0;
|
||||
if (a < 0) {
|
||||
ua = -(u_quad_t)a;
|
||||
neg = 1;
|
||||
} else {
|
||||
ua = a;
|
||||
neg = 0;
|
||||
}
|
||||
if (b < 0)
|
||||
ub = -(u_quad_t)b;
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue