diff options
| author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-06-25 22:32:01 (GMT) |
|---|---|---|
| committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-06-25 22:32:01 (GMT) |
| commit | 6b55f89342181e459f07cee95f7ace98de336b9c (patch) | |
| tree | 6a54f71c1c0cb766930d00d5c709c66750ac9e19 | |
| parent | f5299fe91b8bca422e3a5725a70db8cd134467ab (diff) | |
| parent | 5ef1c629dfce15837e4cb375f572a85c36a27773 (diff) | |
| download | tcl-6b55f89342181e459f07cee95f7ace98de336b9c.zip tcl-6b55f89342181e459f07cee95f7ace98de336b9c.tar.gz tcl-6b55f89342181e459f07cee95f7ace98de336b9c.tar.bz2 | |
Merge 8.6. Also fix mp_get_long_long for VC++ 6.0 (will be deprecated by libtommath)
| -rw-r--r-- | generic/tclTomMath.h | 4 | ||||
| -rw-r--r-- | libtommath/bn_mp_get_long_long.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/generic/tclTomMath.h b/generic/tclTomMath.h index bbcb4bc..9da642e 100644 --- a/generic/tclTomMath.h +++ b/generic/tclTomMath.h @@ -84,7 +84,11 @@ typedef unsigned int mp_digit; #define MP_DIGIT_DECLARED #endif #ifndef MP_WORD_DECLARED +#ifdef _WIN32 +typedef unsigned __int64 mp_word; +#else typedef unsigned long long mp_word; +#endif #define MP_WORD_DECLARED #endif diff --git a/libtommath/bn_mp_get_long_long.c b/libtommath/bn_mp_get_long_long.c index 49a0208..333c6d1 100644 --- a/libtommath/bn_mp_get_long_long.c +++ b/libtommath/bn_mp_get_long_long.c @@ -26,11 +26,11 @@ Tcl_WideUInt mp_get_long_long(const mp_int *a) i = MIN(a->used, (((CHAR_BIT * (int)sizeof(Tcl_WideUInt)) + DIGIT_BIT - 1) / DIGIT_BIT)) - 1; /* get most significant digit of result */ - res = (unsigned long long)a->dp[i]; + res = (Tcl_WideUInt)a->dp[i]; #if DIGIT_BIT < 64 while (--i >= 0) { - res = (res << DIGIT_BIT) | (unsigned long long)a->dp[i]; + res = (res << DIGIT_BIT) | (Tcl_WideUInt)a->dp[i]; } #endif return res; |
