Changeset - r11735:c6daf624a83e
[Not reviewed]
master
0 1 0
rubidium - 15 years ago 2009-04-23 23:29:44
rubidium@openttd.org
(svn r16130) -Fix [FS#2855]: the overflowsafe type didn't like dividing by int64 larger than MAX_INT32 causing division by negative numbers and small anomolies when drawing graphs.
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/core/overflowsafe_type.hpp
Show inline comments
 
@@ -86,7 +86,7 @@ public:
 
	FORCEINLINE OverflowSafeInt operator * (const byte   factor) const { OverflowSafeInt result = *this; result *= (int64)factor; return result; }
 

	
 
	/* Operators for division */
 
	FORCEINLINE OverflowSafeInt& operator /= (const int              divisor)       { this->m_value /= divisor; return *this; }
 
	FORCEINLINE OverflowSafeInt& operator /= (const int64            divisor)       { this->m_value /= divisor; return *this; }
 
	FORCEINLINE OverflowSafeInt  operator /  (const OverflowSafeInt& divisor) const { OverflowSafeInt result = *this; result /= divisor.m_value; return result; }
 
	FORCEINLINE OverflowSafeInt  operator /  (const int              divisor) const { OverflowSafeInt result = *this; result /= divisor; return result; }
 
	FORCEINLINE OverflowSafeInt  operator /  (const uint             divisor) const { OverflowSafeInt result = *this; result /= (int)divisor; return result; }
0 comments (0 inline, 0 general)