From 487caa5868d816ae811c6a68f2bb9b1f5a798dbe Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 16 Jun 2022 08:19:54 -0400 Subject: Fix whitespace and add missing clang-format configuration --- .clang-format | 34 ++++++++++++++++++++++++++++++++++ lv2/core/attributes.h | 4 ++-- plugins/eg-metro.lv2/metro.c | 3 ++- plugins/eg-params.lv2/params.c | 3 ++- 4 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..2ded658 --- /dev/null +++ b/.clang-format @@ -0,0 +1,34 @@ +--- +AlignConsecutiveAssignments: true +AlignConsecutiveDeclarations: true +AlignEscapedNewlinesLeft: true +BasedOnStyle: Mozilla +BraceWrapping: + AfterNamespace: false + AfterClass: true + AfterEnum: false + AfterExternBlock: false + AfterFunction: true + AfterStruct: false + SplitEmptyFunction: false + SplitEmptyRecord: false +BreakBeforeBraces: Custom +Cpp11BracedListStyle: true +IndentCaseLabels: false +IndentPPDirectives: AfterHash +KeepEmptyLinesAtTheStartOfBlocks: false +SpacesInContainerLiterals: false +StatementMacros: + - LV2_DEPRECATED + - LV2_DISABLE_DEPRECATION_WARNINGS + - LV2_RESTORE_WARNINGS + - LV2_SYMBOL_EXPORT + - _Pragma +ForEachMacros: + - LV2_ATOM_OBJECT_BODY_FOREACH + - LV2_ATOM_OBJECT_FOREACH + - LV2_ATOM_SEQUENCE_BODY_FOREACH + - LV2_ATOM_SEQUENCE_FOREACH + - LV2_ATOM_TUPLE_BODY_FOREACH + - LV2_ATOM_TUPLE_FOREACH +... diff --git a/lv2/core/attributes.h b/lv2/core/attributes.h index dfcff3a..81791a2 100644 --- a/lv2/core/attributes.h +++ b/lv2/core/attributes.h @@ -35,11 +35,11 @@ #if defined(__clang__) # define LV2_DISABLE_DEPRECATION_WARNINGS \ _Pragma("clang diagnostic push") \ - _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") + _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") #elif defined(__GNUC__) && __GNUC__ > 4 # define LV2_DISABLE_DEPRECATION_WARNINGS \ _Pragma("GCC diagnostic push") \ - _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") + _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") #else # define LV2_DISABLE_DEPRECATION_WARNINGS #endif diff --git a/plugins/eg-metro.lv2/metro.c b/plugins/eg-metro.lv2/metro.c index 354934b..c89c542 100644 --- a/plugins/eg-metro.lv2/metro.c +++ b/plugins/eg-metro.lv2/metro.c @@ -345,7 +345,8 @@ static const LV2_Descriptor descriptor = { NULL, // extension_data }; -LV2_SYMBOL_EXPORT const LV2_Descriptor* +LV2_SYMBOL_EXPORT +const LV2_Descriptor* lv2_descriptor(uint32_t index) { return index == 0 ? &descriptor : NULL; diff --git a/plugins/eg-params.lv2/params.c b/plugins/eg-params.lv2/params.c index 59f312c..052b43b 100644 --- a/plugins/eg-params.lv2/params.c +++ b/plugins/eg-params.lv2/params.c @@ -526,7 +526,8 @@ static const LV2_Descriptor descriptor = {EG_PARAMS_URI, cleanup, extension_data}; -LV2_SYMBOL_EXPORT const LV2_Descriptor* +LV2_SYMBOL_EXPORT +const LV2_Descriptor* lv2_descriptor(uint32_t index) { return (index == 0) ? &descriptor : NULL; -- cgit v1.2.1