From 3eea219548e84efdbc3148ce378fcba865f97a01 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Fri, 6 Dec 2013 14:15:43 -0800 Subject: Add basic source formatting tools --- src/common/utils2.hpp | 98 +++++++++++++++++++++++++-------------------------- 1 file changed, 49 insertions(+), 49 deletions(-) (limited to 'src/common/utils2.hpp') diff --git a/src/common/utils2.hpp b/src/common/utils2.hpp index 7dbd741..0f72aff 100644 --- a/src/common/utils2.hpp +++ b/src/common/utils2.hpp @@ -1,19 +1,19 @@ #ifndef UTILS2_HPP #define UTILS2_HPP -#include "../sanity.hpp" +# include "../sanity.hpp" -#include -#include -#include -#include -#include +# include +# include +# include +# include +# include -#ifdef __clang__ -# define FALLTHROUGH [[clang::fallthrough]] -#else -# define FALLTHROUGH /* fallthrough */ -#endif +# ifdef __clang__ +# define FALLTHROUGH [[clang::fallthrough]] +# else +# define FALLTHROUGH /* fallthrough */ +# endif template struct earray @@ -136,44 +136,44 @@ struct remove_enum }; -#define ENUM_BITWISE_OPERATORS(E) \ -inline \ -E operator & (E l, E r) \ -{ \ - typedef underlying_type::type U; \ - return E(U(l) & U(r)); \ -} \ -inline \ -E operator | (E l, E r) \ -{ \ - typedef underlying_type::type U; \ - return E(U(l) | U(r)); \ -} \ -inline \ -E operator ^ (E l, E r) \ -{ \ - typedef underlying_type::type U; \ - return E(U(l) ^ U(r)); \ -} \ -inline \ -E& operator &= (E& l, E r) \ -{ \ - return l = l & r; \ -} \ -inline \ -E& operator |= (E& l, E r) \ -{ \ - return l = l | r; \ -} \ -inline \ -E& operator ^= (E& l, E r) \ -{ \ - return l = l ^ r; \ -} \ -inline \ -E operator ~ (E r) \ -{ \ - return E(-1) ^ r; \ +# define ENUM_BITWISE_OPERATORS(E) \ +inline \ +E operator & (E l, E r) \ +{ \ + typedef underlying_type::type U; \ + return E(U(l) & U(r)); \ +} \ +inline \ +E operator | (E l, E r) \ +{ \ + typedef underlying_type::type U; \ + return E(U(l) | U(r)); \ +} \ +inline \ +E operator ^ (E l, E r) \ +{ \ + typedef underlying_type::type U; \ + return E(U(l) ^ U(r)); \ +} \ +inline \ +E& operator &= (E& l, E r) \ +{ \ + return l = l & r; \ +} \ +inline \ +E& operator |= (E& l, E r) \ +{ \ + return l = l | r; \ +} \ +inline \ +E& operator ^= (E& l, E r) \ +{ \ + return l = l ^ r; \ +} \ +inline \ +E operator ~ (E r) \ +{ \ + return E(-1) ^ r; \ } template -- cgit v1.2.3-70-g09d2