1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-01-16 11:30:22 +00:00

Resolve some further warnings.

This commit is contained in:
Thomas Harte 2023-12-05 16:43:55 -05:00
parent 736a3841ce
commit dd04909d58

View File

@ -159,7 +159,7 @@ void imul(
FI;
*/
using sIntT = typename std::make_signed<IntT>::type;
destination_high = (sIntT(destination_low) * sIntT(source)) >> (8 * sizeof(IntT));
destination_high = IntT((sIntT(destination_low) * sIntT(source)) >> (8 * sizeof(IntT)));
destination_low = IntT(sIntT(destination_low) * sIntT(source));
const auto sign_extension = (destination_low & Numeric::top_bit<IntT>()) ? IntT(~0) : 0;
@ -216,7 +216,7 @@ void div(
}
// TEMPORARY HACK. Will not work with DWords.
const uint32_t dividend = (destination_high << (8 * sizeof(IntT))) + destination_low;
const uint32_t dividend = uint32_t((destination_high << (8 * sizeof(IntT))) + destination_low);
const auto result = dividend / source;
if(IntT(result) != result) {
interrupt(Interrupt::DivideError, context);
@ -293,7 +293,7 @@ void idiv(
}
destination_low = IntT(result);
destination_high = dividend % sIntT(source);
destination_high = IntT(dividend % sIntT(source));
}
template <typename IntT, typename ContextT>