Skip to content

Commit 6b7c568

Browse files
committed
fixup x86
1 parent 448e2c3 commit 6b7c568

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

source/mir/bignum/decimal.d

+7-7
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ struct Decimal(uint maxSize64)
781781
{
782782
if (addSign)
783783
w.put(sign[]);
784-
w.put(zeros[0 .. -s + 2]);
784+
w.put(zeros[0 .. cast(sizediff_t)(-s + 2)]);
785785
w.put(buffer[$ - coefficientLength .. $]);
786786
return;
787787
}
@@ -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
}
@@ -822,16 +822,16 @@ struct Decimal(uint maxSize64)
822822
buffer[$ - coefficientLength - 1] = sign[0];
823823
w.put(buffer[$ - coefficientLength - addSign .. $ - coefficientLength + s]);
824824
T2:
825-
buffer[$ - coefficientLength + s - 1] = '.';
826-
w.put(buffer[$ - coefficientLength + s - 1 .. $]);
825+
buffer[$ - coefficientLength + cast(sizediff_t)s - 1] = '.';
826+
w.put(buffer[$ - coefficientLength + cast(sizediff_t)s - 1 .. $]);
827827
return;
828828
}
829829
}
830830
else
831831
{
832832
if (s <= 12 || coefficientLength <= 12)
833833
{
834-
putL(buffer[$ - coefficientLength .. $ - coefficientLength + s]);
834+
putL(buffer[$ - coefficientLength .. $ - coefficientLength + cast(sizediff_t)s]);
835835
goto T2;
836836
}
837837
}
@@ -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)