Skip to content

Commit d82138f

Browse files
committed
fixup x86
1 parent 448e2c3 commit d82138f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

source/mir/bignum/decimal.d

+4-4
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ struct Decimal(uint maxSize64)
737737

738738
C[1] sign = coefficient.sign ? "-" : "+";
739739
bool addSign = coefficient.sign || spec.plus;
740-
long s = this.exponent + coefficientLength;
740+
auto s = cast(sizediff_t) this.exponent + coefficientLength;
741741

742742
alias zeros = zerosImpl!C;
743743

@@ -796,7 +796,7 @@ struct Decimal(uint maxSize64)
796796
{
797797
buffer[$ - coefficientLength - 1] = sign[0];
798798
w.put(buffer[$ - coefficientLength - addSign .. $]);
799-
w.put(zeros[$ - (this.exponent + 2) .. $]);
799+
w.put(zeros[($ - (cast(sizediff_t)this.exponent + 2)) .. $]);
800800
return;
801801
}
802802
}
@@ -805,7 +805,7 @@ struct Decimal(uint maxSize64)
805805
if (s <= 12)
806806
{
807807
buffer0[$ - 16 .. $] = '0';
808-
putL(buffer0[$ - coefficientLength - 16 .. $ - 16 + this.exponent]);
808+
putL(buffer0[$ - coefficientLength - 16 .. $ - 16 + cast(sizediff_t)this.exponent]);
809809
w.put(zeros[$ - 2 .. $]);
810810
return;
811811
}
@@ -991,7 +991,7 @@ struct Decimal(uint maxSize64)
991991
import mir.utility: max;
992992
BigInt!(max(rhsMaxSize64, maxSize64, 256u)) rhsCopy = void;
993993
BigIntView!(const size_t) rhsView;
994-
auto expDiff = exponent - rhs.exponent;
994+
auto expDiff = cast(sizediff_t) (exponent - rhs.exponent);
995995
if (expDiff >= 0)
996996
{
997997
exponent = rhs.exponent;

source/mir/bignum/fp.d

+2-2
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ struct Fp(uint size)
380380
///
381381
Fp!(max(size, rhsSize)) opBinary(string op : "*", uint rhsSize)(Fp!rhsSize rhs) nothrow const
382382
{
383-
return cast(Fp) .extendedMul!(size, rhsSize)(this, rhs);
383+
return cast(Fp) .extendedMul!(size, rhsSize)(cast()this, rhs);
384384
}
385385

386386
static if (size == 128)
@@ -591,7 +591,7 @@ struct Fp(uint size)
591591
// underflow
592592
else
593593
{
594-
ret.coefficient >>= ret.exponent - exponent.min;
594+
ret.coefficient >>= cast(uint)(ret.exponent - exponent.min);
595595
ret.exponent = ret.coefficient ? ret.exponent.min : 0;
596596
}
597597
}

0 commit comments

Comments
 (0)