From 0ad50c61ed80718edb2a1bd77129c27aa8d90508 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Wed, 12 Dec 2018 09:48:41 -0500 Subject: [PATCH] Switch to library integer types The standard ints will cause trouble on older versions of Visual Studio. It looks like they were missed at the initial cut-in. --- donna_32.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/donna_32.cpp b/donna_32.cpp index 04412e34..e290f41f 100644 --- a/donna_32.cpp +++ b/donna_32.cpp @@ -315,15 +315,15 @@ void freduce_degree(limb *output) inline limb div_by_2_26(const limb v) { /* High word of v; no shift needed. */ - const uint32_t highword = (uint32_t) (((uint64_t) v) >> 32); + const word32 highword = (word32) (((word64) v) >> 32); // Modified for SunCC. See comments for SignExtexnd function. /* Set to all 1s if v was negative; else set to 0s. */ - /* const int32_t sign = ((int32_t) highword) >> 31; */ - const int32_t sign = SignExtend(highword); + /* const sword32 sign = ((sword32) highword) >> 31; */ + const sword32 sign = SignExtend(highword); /* Set to 0x3ffffff if v was negative; else set to 0. */ - const int32_t roundoff = ((uint32_t) sign) >> 6; + const sword32 roundoff = ((word32) sign) >> 6; /* Should return v / (1<<26) */ return (v + roundoff) >> 26; } @@ -334,15 +334,15 @@ inline limb div_by_2_26(const limb v) inline limb div_by_2_25(const limb v) { /* High word of v; no shift needed*/ - const uint32_t highword = (uint32_t) (((uint64_t) v) >> 32); + const word32 highword = (word32) (((word64) v) >> 32); // Modified for SunCC. See comments for SignExtexnd function. /* Set to all 1s if v was negative; else set to 0s. */ - /* const int32_t sign = ((int32_t) highword) >> 31; */ - const int32_t sign = SignExtend(highword); + /* const sword32 sign = ((sword32) highword) >> 31; */ + const sword32 sign = SignExtend(highword); /* Set to 0x1ffffff if v was negative; else set to 0. */ - const int32_t roundoff = ((uint32_t) sign) >> 7; + const sword32 roundoff = ((word32) sign) >> 7; /* Should return v / (1<<25) */ return (v + roundoff) >> 25; }