From 679f9932085a4540cde28c993cbe946285163872 Mon Sep 17 00:00:00 2001 From: Hanspeter Portner Date: Tue, 25 Apr 2023 12:53:38 +0200 Subject: [PATCH] Fix compiler warnings --- eteroj.lv2/eteroj.h | 9 +++------ meson_options.txt | 2 +- src/eteroj_cloak.c | 6 +++--- src/eteroj_io.c | 12 ++++++------ src/eteroj_ninja.c | 11 ++++++----- src/eteroj_pack.c | 18 +++++++++--------- 6 files changed, 28 insertions(+), 30 deletions(-) diff --git a/eteroj.lv2/eteroj.h b/eteroj.lv2/eteroj.h index bfd6c7a..906b8c4 100644 --- a/eteroj.lv2/eteroj.h +++ b/eteroj.lv2/eteroj.h @@ -18,13 +18,10 @@ #ifndef _ETEROJ_LV2_H #define _ETEROJ_LV2_H +#define UNUSED __attribute__((unused)) + #include -#if !defined(_WIN32) -# include -#else -# define mlock(...) -# define munlock(...) -#endif +#include #include "lv2/lv2plug.in/ns/ext/atom/atom.h" #include "lv2/lv2plug.in/ns/ext/atom/forge.h" diff --git a/meson_options.txt b/meson_options.txt index 7a5a654..fa2fc3f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -9,4 +9,4 @@ option('lv2libdir', type : 'string', value : 'lib/lv2') -option('version', type : 'string', value : '0.11.27') +option('version', type : 'string', value : '0.11.33') diff --git a/src/eteroj_cloak.c b/src/eteroj_cloak.c index 04ccd07..39ab963 100644 --- a/src/eteroj_cloak.c +++ b/src/eteroj_cloak.c @@ -43,8 +43,8 @@ struct _plughandle_t { }; static LV2_Handle -instantiate(const LV2_Descriptor* descriptor, double rate, - const char *bundle_path, const LV2_Feature *const *features) +instantiate(const LV2_Descriptor* descriptor, double rate UNUSED, + const char *bundle_path UNUSED, const LV2_Feature *const *features) { plughandle_t *handle = calloc(1, sizeof(plughandle_t)); if(!handle) @@ -163,7 +163,7 @@ _7bit_encode(uint8_t *dst, const uint8_t *src, uint32_t size) } static void -run(LV2_Handle instance, uint32_t nsamples) +run(LV2_Handle instance, uint32_t nsamples UNUSED) { plughandle_t *handle = (plughandle_t *)instance; diff --git a/src/eteroj_io.c b/src/eteroj_io.c index 87d23ef..be36a75 100644 --- a/src/eteroj_io.c +++ b/src/eteroj_io.c @@ -174,7 +174,7 @@ _url_change(plughandle_t *handle, const char *url) } static void -_intercept(void *data, int64_t frames, props_impl_t *impl) +_intercept(void *data, int64_t frames UNUSED, props_impl_t *impl) { plughandle_t *handle = data; @@ -205,8 +205,8 @@ static const props_def_t defs [MAX_NPROPS] = { }; static LV2_Handle -instantiate(const LV2_Descriptor* descriptor, double rate, - const char *bundle_path, const LV2_Feature *const *features) +instantiate(const LV2_Descriptor* descriptor, double rate UNUSED, + const char *bundle_path UNUSED, const LV2_Feature *const *features) { plughandle_t *handle = calloc(1, sizeof(plughandle_t)); if(!handle) @@ -672,8 +672,8 @@ static LV2_Worker_Status _work(LV2_Handle instance, LV2_Worker_Respond_Function respond, LV2_Worker_Respond_Handle target, - uint32_t _size, - const void *_body) + uint32_t _size UNUSED, + const void *_body UNUSED) { plughandle_t *handle = instance; char *osc_url = NULL; @@ -740,7 +740,7 @@ _work_response(LV2_Handle instance, uint32_t size, const void *body) // rt-thread static LV2_Worker_Status -_end_run(LV2_Handle instance) +_end_run(LV2_Handle instance UNUSED) { // do nothing diff --git a/src/eteroj_ninja.c b/src/eteroj_ninja.c index 5ea0019..4231131 100644 --- a/src/eteroj_ninja.c +++ b/src/eteroj_ninja.c @@ -125,8 +125,8 @@ static const props_def_t defs [MAX_NPROPS] = { }; static LV2_Handle -instantiate(const LV2_Descriptor* descriptor, double rate, - const char *bundle_path, const LV2_Feature *const *features) +instantiate(const LV2_Descriptor* descriptor, double rate UNUSED, + const char *bundle_path UNUSED, const LV2_Feature *const *features) { plughandle_t *handle = calloc(1, sizeof(plughandle_t)); if(!handle) @@ -293,7 +293,7 @@ _convert_seq(plughandle_t *handle, LV2_Atom_Forge *forge, const LV2_Atom_Sequenc } static void -run(LV2_Handle instance, uint32_t nsamples) +run(LV2_Handle instance, uint32_t nsamples UNUSED) { plughandle_t *handle = (plughandle_t *)instance; @@ -438,7 +438,8 @@ _work(LV2_Handle instance, // rt-thread static LV2_Worker_Status -_work_response(LV2_Handle instance, uint32_t size, const void *body) +_work_response(LV2_Handle instance UNUSED, + uint32_t size UNUSED, const void *body UNUSED) { // do nothing @@ -447,7 +448,7 @@ _work_response(LV2_Handle instance, uint32_t size, const void *body) // rt-thread static LV2_Worker_Status -_end_run(LV2_Handle instance) +_end_run(LV2_Handle instance UNUSED) { // do nothing diff --git a/src/eteroj_pack.c b/src/eteroj_pack.c index 7cfdd83..d620a70 100644 --- a/src/eteroj_pack.c +++ b/src/eteroj_pack.c @@ -26,14 +26,13 @@ #define MAX_NPROPS 2 #define MAX_STRLEN 512 -typedef enum _pack_format_t pack_format_t; -typedef struct _plugstate_t plugstate_t; -typedef struct _plughandle_t plughandle_t; - -enum _pack_format_t { +typedef enum _pack_format_t { PACK_FORMAT_MIDI = 0, PACK_FORMAT_BLOB = 1 -}; +} pack_format_t; + +typedef struct _plugstate_t plugstate_t; +typedef struct _plughandle_t plughandle_t; struct _plugstate_t { char pack_path [MAX_STRLEN]; @@ -75,7 +74,8 @@ static const props_def_t defs [MAX_NPROPS] = { }; static LV2_Handle -instantiate(const LV2_Descriptor* descriptor, double rate, const char *bundle_path, const LV2_Feature *const *features) +instantiate(const LV2_Descriptor* descriptor, double rate UNUSED, + const char *bundle_path UNUSED, const LV2_Feature *const *features) { plughandle_t *handle = calloc(1, sizeof(plughandle_t)); if(!handle) @@ -129,7 +129,7 @@ connect_port(LV2_Handle instance, uint32_t port, void *data) } static void -_unroll(const char *path, const LV2_Atom_Tuple *arguments, void *data) +_unroll(const char *path UNUSED, const LV2_Atom_Tuple *arguments, void *data) { plughandle_t *handle = data; LV2_Atom_Forge *forge = &handle->forge; @@ -168,7 +168,7 @@ _unroll(const char *path, const LV2_Atom_Tuple *arguments, void *data) } static void -run(LV2_Handle instance, uint32_t nsamples) +run(LV2_Handle instance, uint32_t nsamples UNUSED) { plughandle_t *handle = (plughandle_t *)instance; -- 2.38.5