From e89a8e0913640d874432bf2ca5b2495b3dcd8f7e Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sat, 24 Dec 2011 09:55:35 +0100 Subject: [PATCH] Correctly define operators in types.h Be consistent with the way these operators are defined in plain C (and in C++). Spotted by Lucas Braesch. No functional change. Signed-off-by: Marco Costalba --- src/types.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/types.h b/src/types.h index d9efb6e8..ff7cc766 100644 --- a/src/types.h +++ b/src/types.h @@ -323,10 +323,10 @@ inline T operator/ (const T d, int i) { return T(int(d) / i); } \ inline T operator- (const T d) { return T(-int(d)); } \ inline T operator++ (T& d, int) {d = T(int(d) + 1); return d; } \ inline T operator-- (T& d, int) { d = T(int(d) - 1); return d; } \ -inline void operator+= (T& d1, const T d2) { d1 = d1 + d2; } \ -inline void operator-= (T& d1, const T d2) { d1 = d1 - d2; } \ -inline void operator*= (T& d, int i) { d = T(int(d) * i); } \ -inline void operator/= (T& d, int i) { d = T(int(d) / i); } +inline T& operator+= (T& d1, const T d2) { d1 = d1 + d2; return d1; } \ +inline T& operator-= (T& d1, const T d2) { d1 = d1 - d2; return d1; } \ +inline T& operator*= (T& d, int i) { d = T(int(d) * i); return d; } \ +inline T& operator/= (T& d, int i) { d = T(int(d) / i); return d; } ENABLE_OPERATORS_ON(Value) ENABLE_OPERATORS_ON(PieceType) -- 2.30.2