From 162d540a7a78bcd75aea002b4afa101133315e8b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 13 Jan 2019 13:59:29 +0100 Subject: Clean up includes Sorts includes from local to global (which catches errors) and fixes missing includes found by the resulting breakage and include-what-you-use. --- test/bad_syntax.lv2/bad_syntax.c | 5 ++-- test/bad_syntax.lv2/test_bad_syntax.c | 9 ++++++- .../failed_instantiation.c | 5 ++-- .../test_failed_instantiation.c | 9 ++++++- .../failed_lib_descriptor.c | 4 ++-- .../test_failed_lib_descriptor.c | 9 ++++++- test/lib_descriptor.lv2/lib_descriptor.c | 5 ++-- test/lib_descriptor.lv2/test_lib_descriptor.c | 9 ++++++- test/lilv_test.c | 28 ++++++++++++---------- .../test_missing_descriptor.c | 9 ++++++- test/missing_name.lv2/missing_name.c | 5 ++-- test/missing_name.lv2/test_missing_name.c | 9 ++++++- test/missing_plugin.lv2/missing_plugin.c | 5 ++-- test/missing_plugin.lv2/test_missing_plugin.c | 9 ++++++- test/missing_port.lv2/missing_port.c | 5 ++-- test/missing_port.lv2/test_missing_port.c | 9 ++++++- test/missing_port_name.lv2/missing_port_name.c | 5 ++-- .../missing_port_name.lv2/test_missing_port_name.c | 9 ++++++- test/new_version.lv2/new_version.c | 5 ++-- test/old_version.lv2/old_version.c | 5 ++-- test/test.lv2/test.c | 10 ++++---- 21 files changed, 121 insertions(+), 47 deletions(-) (limited to 'test') diff --git a/test/bad_syntax.lv2/bad_syntax.c b/test/bad_syntax.lv2/bad_syntax.c index 52620bd..5d65fa7 100644 --- a/test/bad_syntax.lv2/bad_syntax.c +++ b/test/bad_syntax.lv2/bad_syntax.c @@ -15,10 +15,11 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include - #include "lv2/lv2plug.in/ns/lv2core/lv2.h" +#include +#include + #define PLUGIN_URI "http://example.org/bad-syntax" enum { diff --git a/test/bad_syntax.lv2/test_bad_syntax.c b/test/bad_syntax.lv2/test_bad_syntax.c index d20b8b7..80d9e3c 100644 --- a/test/bad_syntax.lv2/test_bad_syntax.c +++ b/test/bad_syntax.lv2/test_bad_syntax.c @@ -1,6 +1,13 @@ -#include "lilv/lilv.h" #include "../src/lilv_internal.h" +#include "serd/serd.h" +#include "lilv/lilv.h" + +#include +#include +#include +#include + #define PLUGIN_URI "http://example.org/bad-syntax" #define TEST_ASSERT(check) do {\ diff --git a/test/failed_instantiation.lv2/failed_instantiation.c b/test/failed_instantiation.lv2/failed_instantiation.c index aa90532..0a0a5b1 100644 --- a/test/failed_instantiation.lv2/failed_instantiation.c +++ b/test/failed_instantiation.lv2/failed_instantiation.c @@ -15,10 +15,11 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include - #include "lv2/lv2plug.in/ns/lv2core/lv2.h" +#include +#include + #define PLUGIN_URI "http://example.org/failed-instantiation" enum { diff --git a/test/failed_instantiation.lv2/test_failed_instantiation.c b/test/failed_instantiation.lv2/test_failed_instantiation.c index 6efa0ae..9955d3f 100644 --- a/test/failed_instantiation.lv2/test_failed_instantiation.c +++ b/test/failed_instantiation.lv2/test_failed_instantiation.c @@ -1,6 +1,13 @@ -#include "lilv/lilv.h" #include "../src/lilv_internal.h" +#include "lilv/lilv.h" +#include "serd/serd.h" + +#include +#include +#include +#include + #define PLUGIN_URI "http://example.org/failed-instantiation" #define TEST_ASSERT(check) do {\ diff --git a/test/failed_lib_descriptor.lv2/failed_lib_descriptor.c b/test/failed_lib_descriptor.lv2/failed_lib_descriptor.c index 6a1fd90..887960f 100644 --- a/test/failed_lib_descriptor.lv2/failed_lib_descriptor.c +++ b/test/failed_lib_descriptor.lv2/failed_lib_descriptor.c @@ -15,10 +15,10 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include - #include "lv2/lv2plug.in/ns/lv2core/lv2.h" +#include + #define PLUGIN_URI "http://example.org/failed-lib-descriptor" LV2_SYMBOL_EXPORT diff --git a/test/failed_lib_descriptor.lv2/test_failed_lib_descriptor.c b/test/failed_lib_descriptor.lv2/test_failed_lib_descriptor.c index b82eb0a..e4158ee 100644 --- a/test/failed_lib_descriptor.lv2/test_failed_lib_descriptor.c +++ b/test/failed_lib_descriptor.lv2/test_failed_lib_descriptor.c @@ -1,6 +1,13 @@ -#include "lilv/lilv.h" #include "../src/lilv_internal.h" +#include "serd/serd.h" +#include "lilv/lilv.h" + +#include +#include +#include +#include + #define PLUGIN_URI "http://example.org/failed-lib-descriptor" #define TEST_ASSERT(check) do {\ diff --git a/test/lib_descriptor.lv2/lib_descriptor.c b/test/lib_descriptor.lv2/lib_descriptor.c index 48dc775..d51cde0 100644 --- a/test/lib_descriptor.lv2/lib_descriptor.c +++ b/test/lib_descriptor.lv2/lib_descriptor.c @@ -15,10 +15,11 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include - #include "lv2/lv2plug.in/ns/lv2core/lv2.h" +#include +#include + #define PLUGIN_URI "http://example.org/lib-descriptor" enum { diff --git a/test/lib_descriptor.lv2/test_lib_descriptor.c b/test/lib_descriptor.lv2/test_lib_descriptor.c index ff14763..6b6cb02 100644 --- a/test/lib_descriptor.lv2/test_lib_descriptor.c +++ b/test/lib_descriptor.lv2/test_lib_descriptor.c @@ -1,6 +1,13 @@ -#include "lilv/lilv.h" #include "../src/lilv_internal.h" +#include "serd/serd.h" +#include "lilv/lilv.h" + +#include +#include +#include +#include + #define PLUGIN_URI "http://example.org/lib-descriptor" #define TEST_ASSERT(check) do {\ diff --git a/test/lilv_test.c b/test/lilv_test.c index d91e3f9..bc2f597 100644 --- a/test/lilv_test.c +++ b/test/lilv_test.c @@ -18,16 +18,7 @@ #define _POSIX_C_SOURCE 200809L /* for setenv */ #define _XOPEN_SOURCE 600 /* for mkstemp */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "../src/lilv_internal.h" #ifdef _WIN32 # include @@ -37,16 +28,27 @@ # define unsetenv(n) SetEnvironmentVariable((n), NULL) # define mkstemp(pat) _mktemp(pat) #else -# include # include #endif #include "lilv/lilv.h" -#include "../src/lilv_internal.h" - #include "lv2/lv2plug.in/ns/ext/presets/presets.h" #include "lv2/lv2plug.in/ns/ext/state/state.h" #include "lv2/lv2plug.in/ns/ext/urid/urid.h" +#include "lv2/lv2plug.in/ns/lv2core/lv2.h" +#include "serd/serd.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #define TEST_PATH_MAX 1024 diff --git a/test/missing_descriptor.lv2/test_missing_descriptor.c b/test/missing_descriptor.lv2/test_missing_descriptor.c index 49909e1..731b2eb 100644 --- a/test/missing_descriptor.lv2/test_missing_descriptor.c +++ b/test/missing_descriptor.lv2/test_missing_descriptor.c @@ -1,6 +1,13 @@ -#include "lilv/lilv.h" #include "../src/lilv_internal.h" +#include "serd/serd.h" +#include "lilv/lilv.h" + +#include +#include +#include +#include + #define PLUGIN_URI "http://example.org/missing-descriptor" #define TEST_ASSERT(check) do {\ diff --git a/test/missing_name.lv2/missing_name.c b/test/missing_name.lv2/missing_name.c index 6b86e09..02fb74a 100644 --- a/test/missing_name.lv2/missing_name.c +++ b/test/missing_name.lv2/missing_name.c @@ -15,10 +15,11 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include - #include "lv2/lv2plug.in/ns/lv2core/lv2.h" +#include +#include + #define PLUGIN_URI "http://example.org/missing-name" enum { diff --git a/test/missing_name.lv2/test_missing_name.c b/test/missing_name.lv2/test_missing_name.c index 960eec0..8e32d8b 100644 --- a/test/missing_name.lv2/test_missing_name.c +++ b/test/missing_name.lv2/test_missing_name.c @@ -1,6 +1,13 @@ -#include "lilv/lilv.h" #include "../src/lilv_internal.h" +#include "serd/serd.h" +#include "lilv/lilv.h" + +#include +#include +#include +#include + #define PLUGIN_URI "http://example.org/missing-name" #define TEST_ASSERT(check) do {\ diff --git a/test/missing_plugin.lv2/missing_plugin.c b/test/missing_plugin.lv2/missing_plugin.c index 4d21226..26a030c 100644 --- a/test/missing_plugin.lv2/missing_plugin.c +++ b/test/missing_plugin.lv2/missing_plugin.c @@ -15,10 +15,11 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include - #include "lv2/lv2plug.in/ns/lv2core/lv2.h" +#include +#include + #define PLUGIN_URI "http://example.org/missing-plugin" static const LV2_Descriptor descriptor = { diff --git a/test/missing_plugin.lv2/test_missing_plugin.c b/test/missing_plugin.lv2/test_missing_plugin.c index bfc695b..658232e 100644 --- a/test/missing_plugin.lv2/test_missing_plugin.c +++ b/test/missing_plugin.lv2/test_missing_plugin.c @@ -1,6 +1,13 @@ -#include "lilv/lilv.h" #include "../src/lilv_internal.h" +#include "serd/serd.h" +#include "lilv/lilv.h" + +#include +#include +#include +#include + #define PLUGIN_URI "http://example.org/missing-plugin" #define TEST_ASSERT(check) do {\ diff --git a/test/missing_port.lv2/missing_port.c b/test/missing_port.lv2/missing_port.c index dd7e9ff..784b596 100644 --- a/test/missing_port.lv2/missing_port.c +++ b/test/missing_port.lv2/missing_port.c @@ -15,10 +15,11 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include - #include "lv2/lv2plug.in/ns/lv2core/lv2.h" +#include +#include + #define PLUGIN_URI "http://example.org/missing-port" enum { diff --git a/test/missing_port.lv2/test_missing_port.c b/test/missing_port.lv2/test_missing_port.c index c67a1b8..1e76e76 100644 --- a/test/missing_port.lv2/test_missing_port.c +++ b/test/missing_port.lv2/test_missing_port.c @@ -1,6 +1,13 @@ -#include "lilv/lilv.h" #include "../src/lilv_internal.h" +#include "serd/serd.h" +#include "lilv/lilv.h" + +#include +#include +#include +#include + #define PLUGIN_URI "http://example.org/missing-port" #define TEST_ASSERT(check) do {\ diff --git a/test/missing_port_name.lv2/missing_port_name.c b/test/missing_port_name.lv2/missing_port_name.c index 4ed44ed..0b1f7d5 100644 --- a/test/missing_port_name.lv2/missing_port_name.c +++ b/test/missing_port_name.lv2/missing_port_name.c @@ -15,10 +15,11 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include - #include "lv2/lv2plug.in/ns/lv2core/lv2.h" +#include +#include + #define PLUGIN_URI "http://example.org/missing-port-name" enum { diff --git a/test/missing_port_name.lv2/test_missing_port_name.c b/test/missing_port_name.lv2/test_missing_port_name.c index c000247..1187325 100644 --- a/test/missing_port_name.lv2/test_missing_port_name.c +++ b/test/missing_port_name.lv2/test_missing_port_name.c @@ -1,6 +1,13 @@ -#include "lilv/lilv.h" #include "../src/lilv_internal.h" +#include "serd/serd.h" +#include "lilv/lilv.h" + +#include +#include +#include +#include + #define PLUGIN_URI "http://example.org/missing-port-name" #define TEST_ASSERT(check) do {\ diff --git a/test/new_version.lv2/new_version.c b/test/new_version.lv2/new_version.c index 37d9fbf..6e03f4d 100644 --- a/test/new_version.lv2/new_version.c +++ b/test/new_version.lv2/new_version.c @@ -15,10 +15,11 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include - #include "lv2/lv2plug.in/ns/lv2core/lv2.h" +#include +#include + #define PLUGIN_URI "http://example.org/versioned" enum { diff --git a/test/old_version.lv2/old_version.c b/test/old_version.lv2/old_version.c index 303f09c..e75d601 100644 --- a/test/old_version.lv2/old_version.c +++ b/test/old_version.lv2/old_version.c @@ -15,10 +15,11 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include - #include "lv2/lv2plug.in/ns/lv2core/lv2.h" +#include +#include + #define PLUGIN_URI "http://example.org/versioned" enum { diff --git a/test/test.lv2/test.c b/test/test.lv2/test.c index d16e4a9..2bde8cd 100644 --- a/test/test.lv2/test.c +++ b/test/test.lv2/test.c @@ -17,11 +17,6 @@ #define _POSIX_C_SOURCE 200809L -#include -#include -#include -#include - #include "lv2/lv2plug.in/ns/ext/atom/atom.h" #include "lv2/lv2plug.in/ns/ext/state/state.h" #include "lv2/lv2plug.in/ns/ext/urid/urid.h" @@ -32,6 +27,11 @@ # define mkstemp(pat) _mktemp(pat) #endif +#include +#include +#include +#include + #define TEST_URI "http://example.org/lilv-test-plugin" #define TMP_TEMPLATE "lilv_testXXXXXX" -- cgit v1.2.1