summaryrefslogtreecommitdiff
path: root/src/macros.h
diff options
context:
space:
mode:
authortron <tron@openttd.org>2007-02-22 18:44:42 +0000
committertron <tron@openttd.org>2007-02-22 18:44:42 +0000
commit84404cf014800c915de4d0891f07a2c5ea9596ec (patch)
tree4e763db389c70fd5644221cd9c87227d4b8f075c /src/macros.h
parent426d95636740ea8a44d4b76b960be0ceec6f07ba (diff)
downloadopenttd-84404cf014800c915de4d0891f07a2c5ea9596ec.tar.xz
(svn r8846) -Fix
Remove confusing superfluous parentheses
Diffstat (limited to 'src/macros.h')
-rw-r--r--src/macros.h35
1 files changed, 17 insertions, 18 deletions
diff --git a/src/macros.h b/src/macros.h
index 66c0eefc3..20b6024a2 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -43,44 +43,43 @@ static inline uint clampu(uint a, uint min, uint max)
return a;
}
-static inline int32 BIGMULSS(int32 a, int32 b, int shift) {
- return (int32)(((int64)(a) * (int64)(b)) >> (shift));
+static inline int32 BIGMULSS(int32 a, int32 b, int shift)
+{
+ return (int32)((int64)a * (int64)b >> shift);
}
-static inline uint32 BIGMULUS(uint32 a, uint32 b, int shift) {
- return (uint32)(((uint64)(a) * (uint64)(b)) >> (shift));
+static inline uint32 BIGMULUS(uint32 a, uint32 b, int shift)
+{
+ return (uint32)((uint64)a * (uint64)b >> shift);
}
-static inline int64 BIGMULS(int32 a, int32 b) {
- return (int64)(a) * (int64)(b);
+static inline int64 BIGMULS(int32 a, int32 b)
+{
+ return (int64)a * (int64)b;
}
/* OPT: optimized into an unsigned comparison */
//#define IS_INSIDE_1D(x, base, size) ((x) >= (base) && (x) < (base) + (size))
#define IS_INSIDE_1D(x, base, size) ( (uint)((x) - (base)) < ((uint)(size)) )
-template <typename T>
-static inline bool HASBIT(T x, int y)
+template<typename T> static inline bool HASBIT(T x, int y)
{
- return (x & (((T)1) << y)) != 0;
+ return (x & ((T)1 << y)) != 0;
}
-template <typename T>
-static inline T SETBIT(T& x, int y)
+template<typename T> static inline T SETBIT(T& x, int y)
{
- return x |= (((T)1) << y);
+ return x |= (T)1 << y;
}
-template <typename T>
-static inline T CLRBIT(T& x, int y)
+template<typename T> static inline T CLRBIT(T& x, int y)
{
- return x &= ~(((T)1) << y);
+ return x &= ~((T)1 << y);
}
-template <typename T>
-static inline T TOGGLEBIT(T& x, int y)
+template<typename T> static inline T TOGGLEBIT(T& x, int y)
{
- return x ^= (((T)1) << y);
+ return x ^= (T)1 << y;
}