aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-06-16 08:19:54 -0400
committerDavid Robillard <d@drobilla.net>2022-07-17 17:08:38 -0400
commit487caa5868d816ae811c6a68f2bb9b1f5a798dbe (patch)
tree89513dd46b9f58fb52728a0fcf379f020604fdc1
parent556c932d879cc903be96889bd62bc51de5a92b71 (diff)
downloadlv2-487caa5868d816ae811c6a68f2bb9b1f5a798dbe.tar.xz
Fix whitespace and add missing clang-format configuration
-rw-r--r--.clang-format34
-rw-r--r--lv2/core/attributes.h4
-rw-r--r--plugins/eg-metro.lv2/metro.c3
-rw-r--r--plugins/eg-params.lv2/params.c3
4 files changed, 40 insertions, 4 deletions
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;