From 6b7c568e4717d7d70a2e2b9c0b204c7ef92f1a67 Mon Sep 17 00:00:00 2001 From: ilya Date: Thu, 26 May 2022 20:18:19 +0400 Subject: [PATCH] fixup x86 --- source/mir/bignum/decimal.d | 14 +++++++------- source/mir/bignum/fp.d | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/source/mir/bignum/decimal.d b/source/mir/bignum/decimal.d index f5e36418..bcf37680 100644 --- a/source/mir/bignum/decimal.d +++ b/source/mir/bignum/decimal.d @@ -781,7 +781,7 @@ struct Decimal(uint maxSize64) { if (addSign) w.put(sign[]); - w.put(zeros[0 .. -s + 2]); + w.put(zeros[0 .. cast(sizediff_t)(-s + 2)]); w.put(buffer[$ - coefficientLength .. $]); return; } @@ -796,7 +796,7 @@ struct Decimal(uint maxSize64) { buffer[$ - coefficientLength - 1] = sign[0]; w.put(buffer[$ - coefficientLength - addSign .. $]); - w.put(zeros[$ - (this.exponent + 2) .. $]); + w.put(zeros[($ - (cast(sizediff_t)this.exponent + 2)) .. $]); return; } } @@ -805,7 +805,7 @@ struct Decimal(uint maxSize64) if (s <= 12) { buffer0[$ - 16 .. $] = '0'; - putL(buffer0[$ - coefficientLength - 16 .. $ - 16 + this.exponent]); + putL(buffer0[$ - coefficientLength - 16 .. $ - 16 + cast(sizediff_t)this.exponent]); w.put(zeros[$ - 2 .. $]); return; } @@ -822,8 +822,8 @@ struct Decimal(uint maxSize64) buffer[$ - coefficientLength - 1] = sign[0]; w.put(buffer[$ - coefficientLength - addSign .. $ - coefficientLength + s]); T2: - buffer[$ - coefficientLength + s - 1] = '.'; - w.put(buffer[$ - coefficientLength + s - 1 .. $]); + buffer[$ - coefficientLength + cast(sizediff_t)s - 1] = '.'; + w.put(buffer[$ - coefficientLength + cast(sizediff_t)s - 1 .. $]); return; } } @@ -831,7 +831,7 @@ struct Decimal(uint maxSize64) { if (s <= 12 || coefficientLength <= 12) { - putL(buffer[$ - coefficientLength .. $ - coefficientLength + s]); + putL(buffer[$ - coefficientLength .. $ - coefficientLength + cast(sizediff_t)s]); goto T2; } } @@ -991,7 +991,7 @@ struct Decimal(uint maxSize64) import mir.utility: max; BigInt!(max(rhsMaxSize64, maxSize64, 256u)) rhsCopy = void; BigIntView!(const size_t) rhsView; - auto expDiff = exponent - rhs.exponent; + auto expDiff = cast(sizediff_t) (exponent - rhs.exponent); if (expDiff >= 0) { exponent = rhs.exponent; diff --git a/source/mir/bignum/fp.d b/source/mir/bignum/fp.d index 470b13f2..007ccfd9 100644 --- a/source/mir/bignum/fp.d +++ b/source/mir/bignum/fp.d @@ -380,7 +380,7 @@ struct Fp(uint size) /// Fp!(max(size, rhsSize)) opBinary(string op : "*", uint rhsSize)(Fp!rhsSize rhs) nothrow const { - return cast(Fp) .extendedMul!(size, rhsSize)(this, rhs); + return cast(Fp) .extendedMul!(size, rhsSize)(cast()this, rhs); } static if (size == 128) @@ -591,7 +591,7 @@ struct Fp(uint size) // underflow else { - ret.coefficient >>= ret.exponent - exponent.min; + ret.coefficient >>= cast(uint)(ret.exponent - exponent.min); ret.exponent = ret.coefficient ? ret.exponent.min : 0; } }