divmoddi*: Use separate statements instead of the comma operator.

Differential Revision:	https://reviews.freebsd.org/D40835
This commit is contained in:
John Baldwin 2023-07-07 13:01:19 -07:00
parent aa8567656e
commit 9ac841e922
3 changed files with 31 additions and 18 deletions

View File

@ -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);

View File

@ -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)

View File

@ -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