Skip to content

Commit

Permalink
fixup x86
Browse files Browse the repository at this point in the history
  • Loading branch information
9il committed May 26, 2022
1 parent 448e2c3 commit 6b7c568
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions source/mir/bignum/decimal.d
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
}
Expand All @@ -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;
}
Expand All @@ -822,16 +822,16 @@ 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;
}
}
else
{
if (s <= 12 || coefficientLength <= 12)
{
putL(buffer[$ - coefficientLength .. $ - coefficientLength + s]);
putL(buffer[$ - coefficientLength .. $ - coefficientLength + cast(sizediff_t)s]);
goto T2;
}
}
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions source/mir/bignum/fp.d
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}
}
Expand Down

0 comments on commit 6b7c568

Please sign in to comment.