Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151675257
D40832.id124080.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
646 B
Referenced Files
None
Subscribers
None
D40832.id124080.diff
View Options
diff --git a/sys/libkern/divmoddi4.c b/sys/libkern/divmoddi4.c
--- a/sys/libkern/divmoddi4.c
+++ b/sys/libkern/divmoddi4.c
@@ -43,18 +43,18 @@
__divmoddi4(quad_t a, quad_t b, quad_t *rem)
{
u_quad_t ua, ub, uq, urem;
- int neg;
+ int negq, negr;
if (a < 0)
- ua = -(u_quad_t)a, neg = 1;
+ ua = -(u_quad_t)a, negq = 1, negr = 1;
else
- ua = a, neg = 0;
+ ua = a, negq = 0, negr = 0;
if (b < 0)
- ub = -(u_quad_t)b, neg ^= 1;
+ ub = -(u_quad_t)b, negq ^= 1;
else
ub = b;
uq = __qdivrem(ua, ub, &urem);
if (rem != 0)
- *rem = urem;
- return (neg ? -uq : uq);
+ *rem = negr ? -urem: urem;
+ return (negq ? -uq : uq);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Apr 10, 10:53 PM (8 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31251424
Default Alt Text
D40832.id124080.diff (646 B)
Attached To
Mode
D40832: divmoddi4: Handle negative remainders.
Attached
Detach File
Event Timeline
Log In to Comment