mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 08:13:08 +00:00
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 <mcostalba@gmail.com>
This commit is contained in:
parent
d543a64cc7
commit
e89a8e0913
1 changed files with 4 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue