diff -r 12f9ea615cbc -r 314e12e23c3a src/macros.h --- 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 -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 ({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({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::type FOR_ENUM_NAME (__LINE__) = \ - std::underlying_type::type (ENUM::FirstValue); \ - FOR_ENUM_NAME (__LINE__) < std::underlying_type::type (ENUM::NumValues); \ - ++FOR_ENUM_NAME (__LINE__)) \ - for (ENUM NAME = ENUM (FOR_ENUM_NAME (__LINE__)); NAME != ENUM::NumValues; \ + for (std::underlying_type::type FOR_ENUM_NAME(__LINE__) = \ + std::underlying_type::type(ENUM::FirstValue); \ + FOR_ENUM_NAME(__LINE__) < std::underlying_type::type(ENUM::NumValues); \ + ++FOR_ENUM_NAME(__LINE__)) \ + for (ENUM NAME = ENUM(FOR_ENUM_NAME(__LINE__)); NAME != ENUM::NumValues; \ NAME = ENUM::NumValues) #define ConfigOption(...)