From 91fa34ea11919b6a33fc712cc3f059f0b2cab5be Mon Sep 17 00:00:00 2001 From: rubidium Date: Thu, 24 Apr 2008 17:53:45 +0000 Subject: [PATCH] (svn r12873) -Fix [FS#1946]: MSVC is whining because it doesn't understand that bytes should be cast to ints. --- src/core/overflowsafe_type.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/overflowsafe_type.hpp b/src/core/overflowsafe_type.hpp index 8f1f404a7b..882363f1b7 100644 --- a/src/core/overflowsafe_type.hpp +++ b/src/core/overflowsafe_type.hpp @@ -139,9 +139,9 @@ template FORCEINLINE OverflowSafeInt FORCEINLINE OverflowSafeInt operator / (uint a, OverflowSafeInt b) { return (OverflowSafeInt)a / (int)b; } /* Sometimes we got byte operator OverflowSafeInt instead of vice versa. Handle that properly */ -template FORCEINLINE OverflowSafeInt operator + (byte a, OverflowSafeInt b) { return b + a; } -template FORCEINLINE OverflowSafeInt operator - (byte a, OverflowSafeInt b) { return -b + a; } -template FORCEINLINE OverflowSafeInt operator * (byte a, OverflowSafeInt b) { return b * a; } +template FORCEINLINE OverflowSafeInt operator + (byte a, OverflowSafeInt b) { return b + (uint)a; } +template FORCEINLINE OverflowSafeInt operator - (byte a, OverflowSafeInt b) { return -b + (uint)a; } +template FORCEINLINE OverflowSafeInt operator * (byte a, OverflowSafeInt b) { return b * (uint)a; } template FORCEINLINE OverflowSafeInt operator / (byte a, OverflowSafeInt b) { return (OverflowSafeInt)a / (int)b; } typedef OverflowSafeInt OverflowSafeInt64;