diff options
-rw-r--r-- | .clang-format | 65 | ||||
-rw-r--r-- | floattypes.h | 5 | ||||
-rw-r--r-- | selftest.cc | 72 |
3 files changed, 104 insertions, 38 deletions
diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..cce40f6 --- /dev/null +++ b/.clang-format @@ -0,0 +1,65 @@ +--- +Language: Cpp +# BasedOnStyle: LLVM +AccessModifierOffset: -2 +AlignAfterOpenBracket: true +AlignEscapedNewlinesLeft: false +AlignOperands: true +AlignTrailingComments: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AllowShortFunctionsOnASingleLine: All +AlwaysBreakAfterDefinitionReturnType: false +AlwaysBreakTemplateDeclarations: false +AlwaysBreakBeforeMultilineStrings: false +BreakBeforeBinaryOperators: None +BreakBeforeTernaryOperators: true +BreakConstructorInitializersBeforeComma: false +BinPackParameters: true +BinPackArguments: true +ColumnLimit: 80 +ConstructorInitializerAllOnOneLineOrOnePerLine: false +ConstructorInitializerIndentWidth: 4 +DerivePointerAlignment: false +ExperimentalAutoDetectBinPacking: false +IndentCaseLabels: false +IndentWrappedFunctionNames: false +IndentFunctionDeclarationAfterType: false +MaxEmptyLinesToKeep: 1 +KeepEmptyLinesAtTheStartOfBlocks: true +NamespaceIndentation: None +ObjCBlockIndentWidth: 2 +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: true +PenaltyBreakBeforeFirstCallParameter: 19 +PenaltyBreakComment: 300 +PenaltyBreakString: 1000 +PenaltyBreakFirstLessLess: 120 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 60 +PointerAlignment: Right +SpacesBeforeTrailingComments: 1 +Cpp11BracedListStyle: true +Standard: Cpp03 +IndentWidth: 2 +TabWidth: 8 +UseTab: Never +BreakBeforeBraces: Attach +SpacesInParentheses: false +SpacesInSquareBrackets: false +SpacesInAngles: false +SpaceInEmptyParentheses: false +SpacesInCStyleCastParentheses: false +SpaceAfterCStyleCast: false +SpacesInContainerLiterals: true +SpaceBeforeAssignmentOperators: true +ContinuationIndentWidth: 4 +CommentPragmas: '^ IWYU pragma:' +ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] +SpaceBeforeParens: ControlStatements +DisableFormat: false +... + diff --git a/floattypes.h b/floattypes.h index e037b95..fa4cc44 100644 --- a/floattypes.h +++ b/floattypes.h @@ -34,8 +34,9 @@ using namespace std; #ifndef static_assert #define VML_CONCAT2(x, y) x##y #define VML_CONCAT(x, y) VML_CONCAT2(x, y) -#define static_assert(cond, msg) typedef int VML_CONCAT( \ - vml_static_assert_, __LINE__)[(cond) ? 1 : -1] __attribute__((__unused__)) +#define static_assert(cond, msg) \ + typedef int VML_CONCAT(vml_static_assert_, __LINE__)[(cond) ? 1 : -1] \ + __attribute__((__unused__)) #endif // Capture libc macros, then undefine them diff --git a/selftest.cc b/selftest.cc index 334d95f..5e1a943 100644 --- a/selftest.cc +++ b/selftest.cc @@ -1638,78 +1638,78 @@ int main(int argc, char **argv) { cout << "Testing math functions:\n" << "[" VECMATHLIB_CONFIGURATION "]\n" << flush; - vecmathlib_test<realpseudovec<float, 1>>::test(); + vecmathlib_test<realpseudovec<float, 1> >::test(); #ifdef __clang__ - vecmathlib_test<realbuiltinvec<float, 1>>::test(); + vecmathlib_test<realbuiltinvec<float, 1> >::test(); #endif - vecmathlib_test<realtestvec<float, 1>>::test(); + vecmathlib_test<realtestvec<float, 1> >::test(); #ifdef VECMATHLIB_HAVE_VEC_FLOAT_1 - vecmathlib_test<realvec<float, 1>>::test(); + vecmathlib_test<realvec<float, 1> >::test(); #endif - vecmathlib_test<realpseudovec<float, 2>>::test(); + vecmathlib_test<realpseudovec<float, 2> >::test(); #ifdef __clang__ - vecmathlib_test<realbuiltinvec<float, 2>>::test(); + vecmathlib_test<realbuiltinvec<float, 2> >::test(); #endif - vecmathlib_test<realtestvec<float, 2>>::test(); + vecmathlib_test<realtestvec<float, 2> >::test(); #ifdef VECMATHLIB_HAVE_VEC_FLOAT_2 - vecmathlib_test<realvec<float, 2>>::test(); + vecmathlib_test<realvec<float, 2> >::test(); #endif - vecmathlib_test<realpseudovec<float, 4>>::test(); + vecmathlib_test<realpseudovec<float, 4> >::test(); #ifdef __clang__ - vecmathlib_test<realbuiltinvec<float, 4>>::test(); + vecmathlib_test<realbuiltinvec<float, 4> >::test(); #endif - vecmathlib_test<realtestvec<float, 4>>::test(); + vecmathlib_test<realtestvec<float, 4> >::test(); #ifdef VECMATHLIB_HAVE_VEC_FLOAT_4 - vecmathlib_test<realvec<float, 4>>::test(); + vecmathlib_test<realvec<float, 4> >::test(); #endif #ifdef VECMATHLIB_HAVE_VEC_FLOAT_8 - vecmathlib_test<realpseudovec<float, 8>>::test(); + vecmathlib_test<realpseudovec<float, 8> >::test(); #ifdef __clang__ - vecmathlib_test<realbuiltinvec<float, 8>>::test(); + vecmathlib_test<realbuiltinvec<float, 8> >::test(); #endif - vecmathlib_test<realtestvec<float, 8>>::test(); - vecmathlib_test<realvec<float, 8>>::test(); + vecmathlib_test<realtestvec<float, 8> >::test(); + vecmathlib_test<realvec<float, 8> >::test(); #endif #ifdef VECMATHLIB_HAVE_VEC_FLOAT_16 - vecmathlib_test<realpseudovec<float, 16>>::test(); + vecmathlib_test<realpseudovec<float, 16> >::test(); #ifdef __clang__ - vecmathlib_test<realbuiltinvec<float, 16>>::test(); + vecmathlib_test<realbuiltinvec<float, 16> >::test(); #endif - vecmathlib_test<realtestvec<float, 16>>::test(); - vecmathlib_test<realvec<float, 16>>::test(); + vecmathlib_test<realtestvec<float, 16> >::test(); + vecmathlib_test<realvec<float, 16> >::test(); #endif - vecmathlib_test<realpseudovec<double, 1>>::test(); + vecmathlib_test<realpseudovec<double, 1> >::test(); #ifdef __clang__ - vecmathlib_test<realbuiltinvec<double, 1>>::test(); + vecmathlib_test<realbuiltinvec<double, 1> >::test(); #endif - vecmathlib_test<realtestvec<double, 1>>::test(); + vecmathlib_test<realtestvec<double, 1> >::test(); #ifdef VECMATHLIB_HAVE_VEC_DOUBLE_1 - vecmathlib_test<realvec<double, 1>>::test(); + vecmathlib_test<realvec<double, 1> >::test(); #endif - vecmathlib_test<realpseudovec<double, 2>>::test(); + vecmathlib_test<realpseudovec<double, 2> >::test(); #ifdef __clang__ - vecmathlib_test<realbuiltinvec<double, 2>>::test(); + vecmathlib_test<realbuiltinvec<double, 2> >::test(); #endif - vecmathlib_test<realtestvec<double, 2>>::test(); + vecmathlib_test<realtestvec<double, 2> >::test(); #ifdef VECMATHLIB_HAVE_VEC_DOUBLE_2 - vecmathlib_test<realvec<double, 2>>::test(); + vecmathlib_test<realvec<double, 2> >::test(); #endif #ifdef VECMATHLIB_HAVE_VEC_DOUBLE_4 - vecmathlib_test<realpseudovec<double, 4>>::test(); + vecmathlib_test<realpseudovec<double, 4> >::test(); #ifdef __clang__ - vecmathlib_test<realbuiltinvec<double, 4>>::test(); + vecmathlib_test<realbuiltinvec<double, 4> >::test(); #endif - vecmathlib_test<realtestvec<double, 4>>::test(); - vecmathlib_test<realvec<double, 4>>::test(); + vecmathlib_test<realtestvec<double, 4> >::test(); + vecmathlib_test<realvec<double, 4> >::test(); #endif #ifdef VECMATHLIB_HAVE_VEC_DOUBLE_8 - vecmathlib_test<realpseudovec<double, 8>>::test(); + vecmathlib_test<realpseudovec<double, 8> >::test(); #ifdef __clang__ - vecmathlib_test<realbuiltinvec<double, 8>>::test(); + vecmathlib_test<realbuiltinvec<double, 8> >::test(); #endif - vecmathlib_test<realtestvec<double, 8>>::test(); - vecmathlib_test<realvec<double, 8>>::test(); + vecmathlib_test<realtestvec<double, 8> >::test(); + vecmathlib_test<realvec<double, 8> >::test(); #endif cout << "\n"; |