diff --git a/.clang-format b/.clang-format index b2ce7c0e6df0152c3ab0697053d14af385407722..d617cd54e81c5d7212b12acbcb64ff2348f55c85 100644 --- a/.clang-format +++ b/.clang-format @@ -19,9 +19,11 @@ BreakInheritanceList: AfterColon Cpp11BracedListStyle: true DeriveLineEnding: false IndentPPDirectives: AfterHash +InsertNewlineAtEOF: true PackConstructorInitializers: NextLine PPIndentWidth: 1 PointerAlignment: Left +RemoveSemicolon: true SpaceAfterTemplateKeyword: false SpaceBeforeParens: ControlStatements SpaceBeforeCpp11BracedList: true diff --git a/mex/sources/k_order_welfare/approximation_welfare.cc b/mex/sources/k_order_welfare/approximation_welfare.cc index bb56d6e49b3705750f82bf3736acac8d7f9b9309..da65f4d826bdfe6df5170d64ae9a4d7bd23c8f92 100644 --- a/mex/sources/k_order_welfare/approximation_welfare.cc +++ b/mex/sources/k_order_welfare/approximation_welfare.cc @@ -71,4 +71,4 @@ void ApproximationWelfare::saveRuleDerivs(const FGSContainer& W) { cond_ders = std::make_unique<FGSContainer>(W); -} \ No newline at end of file +} diff --git a/mex/sources/libkorder/dynamic_dll.cc b/mex/sources/libkorder/dynamic_dll.cc index 32d1cbe7855effc13c504145081f0a873a67cc8a..a50116d07db0b7d26b340f6b86d6a901dab3e86e 100644 --- a/mex/sources/libkorder/dynamic_dll.cc +++ b/mex/sources/libkorder/dynamic_dll.cc @@ -46,7 +46,10 @@ DynamicModelDLL::DynamicModelDLL(const std::string& modName, int order_arg, "./"s + #endif "+"s + modName + "/+sparse/" + func_name + MEXEXT + // clang-format off + // As of Clang 16, the RemoveSemicolon option incorrectly removes the following semicolon }; + // clang-format on mex_handle_t handle {load_mex(mex_filename)}; if (handle) diff --git a/mex/sources/libkorder/kord/kord_exception.hh b/mex/sources/libkorder/kord/kord_exception.hh index 83508ab924063d054df661360a71e48e7d75a38c..da2ddefd366640473984cefe044cf625cd6bdd3c 100644 --- a/mex/sources/libkorder/kord/kord_exception.hh +++ b/mex/sources/libkorder/kord/kord_exception.hh @@ -31,14 +31,14 @@ #define KORD_RAISE(mes) throw KordException(__FILE__, __LINE__, mes); #define KORD_RAISE_IF(expr, mes) \ - if (expr) \ - throw KordException(__FILE__, __LINE__, mes); + if (expr) \ + throw KordException(__FILE__, __LINE__, mes); #define KORD_RAISE_X(mes, c) throw KordException(__FILE__, __LINE__, mes, c); #define KORD_RAISE_IF_X(expr, mes, c) \ - if (expr) \ - throw KordException(__FILE__, __LINE__, mes, c); + if (expr) \ + throw KordException(__FILE__, __LINE__, mes, c); class KordException { diff --git a/mex/sources/libkorder/tl/permutation.hh b/mex/sources/libkorder/tl/permutation.hh index a41075e287949934535dc1979becd67fd221ed6f..43d40087a4ebf6fd07bc76ad84872e7ac52421b1 100644 --- a/mex/sources/libkorder/tl/permutation.hh +++ b/mex/sources/libkorder/tl/permutation.hh @@ -87,7 +87,7 @@ public: explicit Permutation(const IntSequence& s) : permap(s.size()) { computeSortingMap(s); - }; + } Permutation(const Permutation& p1, const Permutation& p2) : permap(p2.permap) { p1.apply(permap); diff --git a/mex/sources/libkorder/tl/tl_exception.hh b/mex/sources/libkorder/tl/tl_exception.hh index ff5adc8061c986965e4bcfc5e525ad7de748b6df..3c920e86ced7925e2640ef154c9cb97fe0792f4a 100644 --- a/mex/sources/libkorder/tl/tl_exception.hh +++ b/mex/sources/libkorder/tl/tl_exception.hh @@ -62,8 +62,8 @@ #define TL_RAISE(mes) throw TLException(__FILE__, __LINE__, mes) #define TL_RAISE_IF(expr, mes) \ - if (TL_DEBUG >= TL_DEBUG_EXCEPTION && (expr)) \ - throw TLException(__FILE__, __LINE__, mes); + if (TL_DEBUG >= TL_DEBUG_EXCEPTION && (expr)) \ + throw TLException(__FILE__, __LINE__, mes); /* Primitive exception class containing file name, line number and message. */