src/macros.h

changeset 1217
314e12e23c3a
parent 1010
969b48eddd6b
child 1222
34def2630300
--- a/src/macros.h	Thu Jan 04 19:40:52 2018 +0200
+++ b/src/macros.h	Thu Jan 04 19:44:26 2018 +0200
@@ -24,8 +24,8 @@
 #endif
 
 template <typename T, size_t N>
-char (&countofHelper (T(&)[N]))[N];
-#define countof(x) ((int) sizeof (countofHelper(x)))
+char(&countofHelper(T(&)[N]))[N];
+#define countof(x)((int) sizeof(countofHelper(x)))
 
 #define DEFINE_CLASS(SELF, SUPER) \
 public: \
@@ -40,16 +40,16 @@
 # define DIRSLASH_CHAR '/'
 #endif // WIN32
 
-#define dvalof(A) dprint ("value of '%1' = %2\n", #A, A)
-#define for_axes(AX) for (const Axis AX : std::initializer_list<const Axis> ({X, Y, Z}))
+#define dvalof(A) dprint("value of '%1' = %2\n", #A, A)
+#define for_axes(AX) for (const Axis AX : std::initializer_list<const Axis>({X, Y, Z}))
 
 #define MAKE_ITERABLE_ENUM(T) \
-	inline T operator++ (T& a) { a = (T) ((int) a + 1); return a; } \
-	inline T operator-- (T& a) { a = (T) ((int) a - 1); return a; } \
-	inline T operator++ (T& a, int) { T result = a; a = (T) ((int) a + 1); return result; } \
-	inline T operator-- (T& a, int) { T result = a; a = (T) ((int) a - 1); return result; }
+	inline T operator++(T& a) { a = (T)((int) a + 1); return a; } \
+	inline T operator--(T& a) { a = (T)((int) a - 1); return a; } \
+	inline T operator++(T& a, int) { T result = a; a = (T)((int) a + 1); return result; } \
+	inline T operator--(T& a, int) { T result = a; a = (T)((int) a - 1); return result; }
 
-#if QT_VERSION >= QT_VERSION_CHECK (5, 0, 0)
+#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
 # define USE_QT5
 #endif
 
@@ -57,11 +57,11 @@
 #define FOR_ENUM_NAME(LINE) FOR_ENUM_NAME_HELPER(LINE)
 
 #define for_enum(ENUM, NAME) \
-	for (std::underlying_type<ENUM>::type FOR_ENUM_NAME (__LINE__) = \
-		std::underlying_type<ENUM>::type (ENUM::FirstValue); \
-		FOR_ENUM_NAME (__LINE__) < std::underlying_type<ENUM>::type (ENUM::NumValues); \
-		++FOR_ENUM_NAME (__LINE__)) \
-	for (ENUM NAME = ENUM (FOR_ENUM_NAME (__LINE__)); NAME != ENUM::NumValues; \
+	for (std::underlying_type<ENUM>::type FOR_ENUM_NAME(__LINE__) = \
+		std::underlying_type<ENUM>::type(ENUM::FirstValue); \
+		FOR_ENUM_NAME(__LINE__) < std::underlying_type<ENUM>::type(ENUM::NumValues); \
+		++FOR_ENUM_NAME(__LINE__)) \
+	for (ENUM NAME = ENUM(FOR_ENUM_NAME(__LINE__)); NAME != ENUM::NumValues; \
 		NAME = ENUM::NumValues)
 
 #define ConfigOption(...)

mercurial