aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-10-17 15:43:18 +0200
committerDavid Robillard <d@drobilla.net>2019-10-17 15:43:18 +0200
commitb4a3042da84420b80db0c81b90cd2df40a18f1c9 (patch)
tree13ab68db50c61f332b948f248fe1c6b206f88712
parentba6f8e44590e19ff65274cf919e63f4035130ccb (diff)
downloadjalv-b4a3042da84420b80db0c81b90cd2df40a18f1c9.tar.gz
jalv-b4a3042da84420b80db0c81b90cd2df40a18f1c9.tar.bz2
jalv-b4a3042da84420b80db0c81b90cd2df40a18f1c9.zip
Clean up includes
-rw-r--r--src/jack.c6
-rw-r--r--src/jalv.c39
-rw-r--r--src/jalv_console.c10
-rw-r--r--src/jalv_gtk.c9
-rw-r--r--src/jalv_gtkmm2.cpp4
-rw-r--r--src/jalv_internal.h27
-rw-r--r--src/jalv_qt.cpp8
-rw-r--r--src/lv2_evbuf.c8
-rw-r--r--src/portaudio.c6
-rw-r--r--src/state.c18
-rw-r--r--src/symap.c4
-rw-r--r--src/worker.h4
-rw-r--r--src/zix/ring.c8
-rw-r--r--src/zix/ring.h4
-rw-r--r--src/zix/sem.h4
-rw-r--r--src/zix/thread.h4
16 files changed, 78 insertions, 85 deletions
diff --git a/src/jack.c b/src/jack.c
index 11edc31..50160e2 100644
--- a/src/jack.c
+++ b/src/jack.c
@@ -14,7 +14,8 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <ctype.h>
+#include "jalv_internal.h"
+#include "worker.h"
#include <jack/jack.h>
#include <jack/midiport.h>
@@ -25,8 +26,7 @@
# include <jack/metadata.h>
#endif
-#include "jalv_internal.h"
-#include "worker.h"
+#include <ctype.h>
struct JalvBackend {
jack_client_t* client; ///< Jack client
diff --git a/src/jalv.c b/src/jalv.c
index 46aaa3d..1477040 100644
--- a/src/jalv.c
+++ b/src/jalv.c
@@ -17,28 +17,10 @@
#define _POSIX_C_SOURCE 200809L /* for mkdtemp */
#define _DARWIN_C_SOURCE /* for mkdtemp on OSX */
-#include <assert.h>
-#include <math.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-
-#ifndef __cplusplus
-# include <stdbool.h>
-#endif
-
-#ifdef _WIN32
-# include <io.h> /* for _mktemp */
-# define snprintf _snprintf
-#else
-# include <unistd.h>
-#endif
-
#include "jalv_config.h"
#include "jalv_internal.h"
+#include "lv2_evbuf.h"
+#include "worker.h"
#include "lv2/atom/atom.h"
#include "lv2/buf-size/buf-size.h"
@@ -61,8 +43,21 @@
#include "suil/suil.h"
#endif
-#include "lv2_evbuf.h"
-#include "worker.h"
+#ifdef _WIN32
+# include <io.h> /* for _mktemp */
+# define snprintf _snprintf
+#else
+# include <unistd.h>
+#endif
+
+#include <assert.h>
+#include <math.h>
+#include <signal.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <sys/types.h>
#define NS_RDF "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
#define NS_XSD "http://www.w3.org/2001/XMLSchema#"
diff --git a/src/jalv_console.c b/src/jalv_console.c
index 5c3ffe4..413a524 100644
--- a/src/jalv_console.c
+++ b/src/jalv_console.c
@@ -19,16 +19,16 @@
#define _BSD_SOURCE 1
#define _DEFAULT_SOURCE 1
-#include <stdbool.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
#include "jalv_config.h"
#include "jalv_internal.h"
#include "lv2/ui/ui.h"
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
static int
print_usage(const char* name, bool error)
{
diff --git a/src/jalv_gtk.c b/src/jalv_gtk.c
index 4fbdc3f..68cab2d 100644
--- a/src/jalv_gtk.c
+++ b/src/jalv_gtk.c
@@ -14,14 +14,14 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <math.h>
-
-#include <gtk/gtk.h>
+#include "jalv_internal.h"
#include "lv2/patch/patch.h"
#include "lv2/port-props/port-props.h"
-#include "jalv_internal.h"
+#include <gtk/gtk.h>
+
+#include <math.h>
#if GTK_MAJOR_VERSION == 3
#if defined(__clang__)
@@ -1245,4 +1245,3 @@ jalv_close_ui(ZIX_UNUSED Jalv* jalv)
# pragma GCC diagnostic pop
#endif
#endif
-
diff --git a/src/jalv_gtkmm2.cpp b/src/jalv_gtkmm2.cpp
index 7e70a07..52994f7 100644
--- a/src/jalv_gtkmm2.cpp
+++ b/src/jalv_gtkmm2.cpp
@@ -14,12 +14,12 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "jalv_internal.h"
+
#include <gtkmm/button.h>
#include <gtkmm/main.h>
#include <gtkmm/window.h>
-#include "jalv_internal.h"
-
Gtk::Main* jalv_gtk_main = NULL;
int
diff --git a/src/jalv_internal.h b/src/jalv_internal.h
index 404d715..d0b1875 100644
--- a/src/jalv_internal.h
+++ b/src/jalv_internal.h
@@ -17,15 +17,16 @@
#ifndef JALV_INTERNAL_H
#define JALV_INTERNAL_H
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#ifdef HAVE_ISATTY
-# include <unistd.h>
-#endif
+#include "lv2_evbuf.h"
+#include "symap.h"
+
+#include "zix/ring.h"
+#include "zix/sem.h"
+#include "zix/thread.h"
#include "lilv/lilv.h"
#include "serd/serd.h"
+#include "sratom/sratom.h"
#ifdef HAVE_SUIL
#include "suil/suil.h"
#endif
@@ -41,14 +42,12 @@
#include "lv2/urid/urid.h"
#include "lv2/worker/worker.h"
-#include "zix/ring.h"
-#include "zix/sem.h"
-#include "zix/thread.h"
-
-#include "sratom/sratom.h"
-
-#include "lv2_evbuf.h"
-#include "symap.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#ifdef HAVE_ISATTY
+# include <unistd.h>
+#endif
#ifdef __clang__
# define REALTIME __attribute__((annotate("realtime")))
diff --git a/src/jalv_qt.cpp b/src/jalv_qt.cpp
index 267167e..3661b34 100644
--- a/src/jalv_qt.cpp
+++ b/src/jalv_qt.cpp
@@ -14,10 +14,6 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <algorithm>
-#include <cmath>
-#include <cstdio>
-
#include "jalv_internal.h"
#include "lv2/patch/patch.h"
@@ -44,6 +40,10 @@
# include <QtGui>
#endif
+#include <algorithm>
+#include <cmath>
+#include <cstdio>
+
#define CONTROL_WIDTH 150
#define DIAL_STEPS 10000
diff --git a/src/lv2_evbuf.c b/src/lv2_evbuf.c
index bd17f49..a64d860 100644
--- a/src/lv2_evbuf.c
+++ b/src/lv2_evbuf.c
@@ -14,13 +14,13 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <assert.h>
-#include <stdlib.h>
-#include <string.h>
+#include "lv2_evbuf.h"
#include "lv2/atom/atom.h"
-#include "lv2_evbuf.h"
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
struct LV2_Evbuf_Impl {
uint32_t capacity;
diff --git a/src/portaudio.c b/src/portaudio.c
index 1425e4d..bbcf008 100644
--- a/src/portaudio.c
+++ b/src/portaudio.c
@@ -14,13 +14,13 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "jalv_internal.h"
+#include "worker.h"
+
#include <stdio.h>
#include <math.h>
#include <portaudio.h>
-#include "jalv_internal.h"
-#include "worker.h"
-
struct JalvBackend {
PaStream* stream;
};
diff --git a/src/state.c b/src/state.c
index 899e61f..dab6c02 100644
--- a/src/state.c
+++ b/src/state.c
@@ -14,13 +14,8 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <sys/stat.h>
-#include <sys/types.h>
+#include "jalv_config.h"
+#include "jalv_internal.h"
#ifdef HAVE_LV2_STATE
# include "lv2/lv2plug.in/ns/ext/state/state.h"
@@ -28,8 +23,13 @@
#include "lilv/lilv.h"
-#include "jalv_config.h"
-#include "jalv_internal.h"
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <sys/types.h>
#define NS_JALV "http://drobilla.net/ns/jalv#"
#define NS_RDF "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
diff --git a/src/symap.c b/src/symap.c
index 0b567e8..afcdadb 100644
--- a/src/symap.c
+++ b/src/symap.c
@@ -14,13 +14,13 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#include "symap.h"
+
#include <assert.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
-#include "symap.h"
-
/**
@file symap.c Implementation of Symap, a basic symbol map (string interner).
diff --git a/src/worker.h b/src/worker.h
index 0da6776..942b993 100644
--- a/src/worker.h
+++ b/src/worker.h
@@ -14,10 +14,10 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include "lv2/worker/worker.h"
-
#include "jalv_internal.h"
+#include "lv2/worker/worker.h"
+
void
jalv_worker_init(Jalv* jalv,
JalvWorker* worker,
diff --git a/src/zix/ring.c b/src/zix/ring.c
index a76b4ea..6af9e07 100644
--- a/src/zix/ring.c
+++ b/src/zix/ring.c
@@ -14,9 +14,7 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
+#include "zix/ring.h"
#ifdef HAVE_MLOCK
# include <sys/mman.h>
@@ -50,7 +48,9 @@
# define ZIX_READ_BARRIER()
#endif
-#include "zix/ring.h"
+#include <stdint.h>
+#include <stdlib.h>
+#include <string.h>
struct ZixRingImpl {
uint32_t write_head; ///< Read index into buf
diff --git a/src/zix/ring.h b/src/zix/ring.h
index f7f1893..c687667 100644
--- a/src/zix/ring.h
+++ b/src/zix/ring.h
@@ -17,10 +17,10 @@
#ifndef ZIX_RING_H
#define ZIX_RING_H
-#include <stdint.h>
-
#include "zix/common.h"
+#include <stdint.h>
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/src/zix/sem.h b/src/zix/sem.h
index 1fea796..e306052 100644
--- a/src/zix/sem.h
+++ b/src/zix/sem.h
@@ -17,6 +17,8 @@
#ifndef ZIX_SEM_H
#define ZIX_SEM_H
+#include "zix/common.h"
+
#ifdef __APPLE__
# include <mach/mach.h>
#elif defined(_WIN32)
@@ -27,8 +29,6 @@
# include <errno.h>
#endif
-#include "zix/common.h"
-
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/src/zix/thread.h b/src/zix/thread.h
index b007efa..5802c99 100644
--- a/src/zix/thread.h
+++ b/src/zix/thread.h
@@ -17,6 +17,8 @@
#ifndef ZIX_THREAD_H
#define ZIX_THREAD_H
+#include "zix/common.h"
+
#ifdef _WIN32
# include <windows.h>
#else
@@ -24,8 +26,6 @@
# include <pthread.h>
#endif
-#include "zix/common.h"
-
#ifdef __cplusplus
extern "C" {
#else