diff --git a/ttmath/ttmath.h b/ttmath/ttmath.h index 2d64dc2..8375683 100644 --- a/ttmath/ttmath.h +++ b/ttmath/ttmath.h @@ -46,10 +46,12 @@ */ #ifdef _MSC_VER -#pragma warning( disable: 4127 ) //warning C4127: conditional expression is constant -#pragma warning( disable: 4702 ) +#pragma warning( disable: 4127 ) //warning C4702: unreachable code +#pragma warning( disable: 4702 ) +//warning C4800: forcing value to bool 'true' or 'false' (performance warning) +#pragma warning( disable: 4800 ) #endif @@ -2822,10 +2824,12 @@ namespace ttmath #ifdef _MSC_VER -#pragma warning( default: 4127 ) //warning C4127: conditional expression is constant -#pragma warning( disable: 4702 ) +#pragma warning( default: 4127 ) //warning C4702: unreachable code +#pragma warning( default: 4702 ) +//warning C4800: forcing value to bool 'true' or 'false' (performance warning) +#pragma warning( default: 4800 ) #endif #endif diff --git a/ttmath/ttmathbig.h b/ttmath/ttmathbig.h index 819cae1..1a6fb19 100644 --- a/ttmath/ttmathbig.h +++ b/ttmath/ttmathbig.h @@ -3401,17 +3401,17 @@ private: Int & new_exp, uint bits) const { - int move; // how many times move the mantissa + sint move; // how many times move the mantissa UInt man_temp(mantissa); // man+1 for moving new_exp = exponent; - new_exp.DivInt((int)bits, move); + new_exp.DivInt((sint)bits, move); if( move != 0 ) { // we're moving the man_temp to left-hand side if( move < 0 ) { - move = bits + move; + move = sint(bits) + move; new_exp.SubOne(); // when move is < than 0 then new_exp is < 0 too } diff --git a/ttmath/ttmathint.h b/ttmath/ttmathint.h index 4d2fe61..78b86e9 100644 --- a/ttmath/ttmathint.h +++ b/ttmath/ttmathint.h @@ -482,7 +482,7 @@ public: in other words: this(old) = ss2 * this(new)(result) + remainder */ - uint DivInt(int ss2, int * remainder = 0) + uint DivInt(sint ss2, sint * remainder = 0) { bool ss1_is_sign, ss2_is_sign; @@ -512,16 +512,16 @@ public: if( remainder ) { if( ss1_is_sign ) - *remainder = -int(rem); + *remainder = -sint(rem); else - *remainder = int(rem); + *remainder = sint(rem); } return c; } - uint DivInt(int ss2, int & remainder) + uint DivInt(sint ss2, sint & remainder) { return DivInt(ss2, &remainder); } diff --git a/ttmath/ttmathtypes.h b/ttmath/ttmathtypes.h index 58817e9..c497c58 100644 --- a/ttmath/ttmathtypes.h +++ b/ttmath/ttmathtypes.h @@ -356,10 +356,10 @@ namespace ttmath default: true e.g. - Conv c; - c.base_round = false; - Big<1, 1> a = "0.1"; // decimal input - std::cout << a.ToString(c) << std::endl; // the result is: 0.099999999 + Conv c; + c.base_round = false; + Big<1, 1> a = "0.1"; // decimal input + std::cout << a.ToString(c) << std::endl; // the result is: 0.099999999 */ bool base_round;