summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library/BaseLib/Ia32/DivS64x64Remainder.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdePkg/Library/BaseLib/Ia32/DivS64x64Remainder.c')
-rw-r--r--MdePkg/Library/BaseLib/Ia32/DivS64x64Remainder.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/MdePkg/Library/BaseLib/Ia32/DivS64x64Remainder.c b/MdePkg/Library/BaseLib/Ia32/DivS64x64Remainder.c
index 4e64964042..4604208403 100644
--- a/MdePkg/Library/BaseLib/Ia32/DivS64x64Remainder.c
+++ b/MdePkg/Library/BaseLib/Ia32/DivS64x64Remainder.c
@@ -28,20 +28,21 @@
INT64
EFIAPI
InternalMathDivRemS64x64 (
- IN INT64 Dividend,
- IN INT64 Divisor,
- OUT INT64 *Remainder OPTIONAL
+ IN INT64 Dividend,
+ IN INT64 Divisor,
+ OUT INT64 *Remainder OPTIONAL
)
{
- INT64 Quot;
+ INT64 Quot;
Quot = InternalMathDivRemU64x64 (
- (UINT64) (Dividend >= 0 ? Dividend : -Dividend),
- (UINT64) (Divisor >= 0 ? Divisor : -Divisor),
- (UINT64 *) Remainder
+ (UINT64)(Dividend >= 0 ? Dividend : -Dividend),
+ (UINT64)(Divisor >= 0 ? Divisor : -Divisor),
+ (UINT64 *)Remainder
);
- if (Remainder != NULL && Dividend < 0) {
+ if ((Remainder != NULL) && (Dividend < 0)) {
*Remainder = -*Remainder;
}
+
return (Dividend ^ Divisor) >= 0 ? Quot : -Quot;
}