Browse Source

Fix unused parameter warnings

add_opts_to_lv2apply
David Robillard 8 months ago
parent
commit
1d05475049
  1. 3
      NEWS
  2. 26
      bindings/test/bindings_test_plugin.c
  3. 9
      src/collections.c
  4. 2
      src/plugin.c
  5. 12
      src/port.c
  6. 12
      src/state.c
  7. 19
      src/world.c
  8. 7
      test/bad_syntax.lv2/bad_syntax.c
  9. 20
      test/failed_instantiation.lv2/failed_instantiation.c
  10. 3
      test/failed_lib_descriptor.lv2/failed_lib_descriptor.c
  11. 12
      test/lib_descriptor.lv2/lib_descriptor.c
  12. 7
      test/missing_name.lv2/missing_name.c
  13. 7
      test/missing_port.lv2/missing_port.c
  14. 7
      test/missing_port_name.lv2/missing_port_name.c
  15. 7
      test/new_version.lv2/new_version.c
  16. 7
      test/old_version.lv2/old_version.c
  17. 8
      test/test.lv2/test.c
  18. 2
      test/test_filesystem.c
  19. 16
      test/test_state.c
  20. 2
      utils/lilv-bench.c
  21. 2
      wscript

3
NEWS

@ -1,8 +1,9 @@
lilv (0.24.13) unstable;
* Fix unused parameter warnings
* Update zix tree
-- David Robillard <d@drobilla.net> Mon, 11 Jan 2021 11:20:00 +0000
-- David Robillard <d@drobilla.net> Mon, 11 Jan 2021 11:20:41 +0000
lilv (0.24.12) stable;

26
bindings/test/bindings_test_plugin.c

@ -73,6 +73,11 @@ instantiate(const LV2_Descriptor* descriptor,
const char* bundle_path,
const LV2_Feature* const* features)
{
(void)descriptor;
(void)rate;
(void)bundle_path;
(void)features;
Test* test = (Test*)malloc(sizeof(Test));
return (LV2_Handle)test;
@ -88,7 +93,11 @@ instantiate(const LV2_Descriptor* descriptor,
*/
static void
connect_port(LV2_Handle instance, uint32_t port, void* data)
{}
{
(void)instance;
(void)port;
(void)data;
}
/**
The activate() method is called by the host to initialise and prepare the
@ -101,12 +110,17 @@ connect_port(LV2_Handle instance, uint32_t port, void* data)
*/
static void
activate(LV2_Handle instance)
{}
{
(void)instance;
}
/** Process a block of audio (audio thread, must be RT safe). */
static void
run(LV2_Handle instance, uint32_t n_samples)
{}
{
(void)instance;
(void)n_samples;
}
/**
The deactivate() method is the counterpart to activate() called by the host
@ -121,7 +135,9 @@ run(LV2_Handle instance, uint32_t n_samples)
*/
static void
deactivate(LV2_Handle instance)
{}
{
(void)instance;
}
/**
Destroy a plugin instance (counterpart to instantiate()).
@ -148,6 +164,8 @@ cleanup(LV2_Handle instance)
static const void*
extension_data(const char* uri)
{
(void)uri;
return NULL;
}

9
src/collections.c

@ -28,14 +28,19 @@
int
lilv_ptr_cmp(const void* a, const void* b, const void* user_data)
{
(void)user_data;
return (intptr_t)a - (intptr_t)b;
}
int
lilv_resource_node_cmp(const void* a, const void* b, const void* user_data)
{
(void)user_data;
const SordNode* an = ((const LilvNode*)a)->node;
const SordNode* bn = ((const LilvNode*)b)->node;
return (intptr_t)an - (intptr_t)bn;
}
@ -70,6 +75,8 @@ lilv_collection_begin(const LilvCollection* collection)
void*
lilv_collection_get(const LilvCollection* collection, const LilvIter* i)
{
(void)collection;
return zix_tree_get((const ZixTreeIter*)i);
}
@ -185,11 +192,13 @@ lilv_nodes_merge(const LilvNodes* a, const LilvNodes* b)
\
LilvIter* prefix##_next(const CT* collection, LilvIter* i) \
{ \
(void)collection; \
return zix_tree_iter_next((ZixTreeIter*)i); \
} \
\
bool prefix##_is_end(const CT* collection, LilvIter* i) \
{ \
(void)collection; \
return zix_tree_iter_is_end((ZixTreeIter*)i); \
}

2
src/plugin.c

@ -1095,6 +1095,8 @@ lilv_plugin_write_manifest_entry(LilvWorld* world,
FILE* manifest_file,
const char* plugin_file_path)
{
(void)world;
const LilvNode* subject = lilv_plugin_get_uri(plugin);
const SerdNode* base = sord_node_to_serd_node(base_uri->node);
SerdEnv* env = new_lv2_env(base);

12
src/port.c

@ -47,6 +47,8 @@ lilv_port_new(LilvWorld* world,
void
lilv_port_free(const LilvPlugin* plugin, LilvPort* port)
{
(void)plugin;
if (port) {
lilv_node_free(port->node);
lilv_nodes_free(port->classes);
@ -60,6 +62,8 @@ lilv_port_is_a(const LilvPlugin* plugin,
const LilvPort* port,
const LilvNode* port_class)
{
(void)plugin;
LILV_FOREACH (nodes, i, port->classes) {
if (lilv_node_equals(lilv_nodes_get(port->classes, i), port_class)) {
return true;
@ -112,6 +116,8 @@ lilv_port_get_value_by_node(const LilvPlugin* plugin,
const LilvNode*
lilv_port_get_node(const LilvPlugin* plugin, const LilvPort* port)
{
(void)plugin;
return port->node;
}
@ -146,12 +152,16 @@ lilv_port_get(const LilvPlugin* plugin,
uint32_t
lilv_port_get_index(const LilvPlugin* plugin, const LilvPort* port)
{
(void)plugin;
return port->index;
}
const LilvNode*
lilv_port_get_symbol(const LilvPlugin* plugin, const LilvPort* port)
{
(void)plugin;
return port->symbol;
}
@ -181,6 +191,8 @@ lilv_port_get_name(const LilvPlugin* plugin, const LilvPort* port)
const LilvNodes*
lilv_port_get_classes(const LilvPlugin* plugin, const LilvPort* port)
{
(void)plugin;
return port->classes;
}

12
src/state.c

@ -83,12 +83,16 @@ struct LilvStateImpl {
static int
abs_cmp(const void* a, const void* b, const void* user_data)
{
(void)user_data;
return strcmp(((const PathMap*)a)->abs, ((const PathMap*)b)->abs);
}
static int
rel_cmp(const void* a, const void* b, const void* user_data)
{
(void)user_data;
return strcmp(((const PathMap*)a)->rel, ((const PathMap*)b)->rel);
}
@ -241,6 +245,8 @@ retrieve_callback(LV2_State_Handle handle,
static bool
path_exists(const char* path, const void* ignored)
{
(void)ignored;
return lilv_path_exists(path);
}
@ -414,6 +420,8 @@ state_strerror(LV2_State_Status st)
static void
lilv_free_path(LV2_State_Free_Path_Handle handle, char* path)
{
(void)handle;
lilv_free(path);
}
@ -885,6 +893,8 @@ write_manifest(LilvWorld* world,
SordModel* model,
const SerdNode* file_uri)
{
(void)world;
char* const path = (char*)serd_file_uri_parse(file_uri->buf, NULL);
FILE* const wfd = fopen(path, "w");
if (!wfd) {
@ -1069,6 +1079,8 @@ lilv_state_write(LilvWorld* world,
const char* uri,
const char* dir)
{
(void)world;
SerdNode lv2_appliesTo =
serd_node_from_string(SERD_CURIE, USTR("lv2:appliesTo"));

19
src/world.c

@ -358,8 +358,11 @@ lilv_world_blank_node_prefix(LilvWorld* world)
int
lilv_header_compare_by_uri(const void* a, const void* b, const void* user_data)
{
(void)user_data;
const struct LilvHeader* const header_a = (const struct LilvHeader*)a;
const struct LilvHeader* const header_b = (const struct LilvHeader*)b;
return strcmp(lilv_node_as_uri(header_a->uri),
lilv_node_as_uri(header_b->uri));
}
@ -374,9 +377,14 @@ lilv_header_compare_by_uri(const void* a, const void* b, const void* user_data)
int
lilv_lib_compare(const void* a, const void* b, const void* user_data)
{
(void)user_data;
const LilvLib* const lib_a = (const LilvLib*)a;
const LilvLib* const lib_b = (const LilvLib*)b;
int cmp = strcmp(lilv_node_as_uri(lib_a->uri), lilv_node_as_uri(lib_b->uri));
const int cmp =
strcmp(lilv_node_as_uri(lib_a->uri), lilv_node_as_uri(lib_b->uri));
return cmp ? cmp : strcmp(lib_a->bundle_path, lib_b->bundle_path);
}
@ -434,6 +442,8 @@ lilv_world_add_plugin(LilvWorld* world,
void* dynmanifest,
const SordNode* bundle)
{
(void)dynmanifest;
LilvNode* plugin_uri = lilv_node_new_from_node(world, plugin_node);
ZixTreeIter* z = NULL;
LilvPlugin* plugin =
@ -636,7 +646,12 @@ lilv_world_load_dyn_manifest(LilvWorld* world,
}
sord_iter_free(iter);
sord_free(model);
#endif // LILV_DYN_MANIFEST
#else // LILV_DYN_MANIFEST
(void)world;
(void)bundle_node;
(void)manifest;
#endif
}
#ifdef LILV_DYN_MANIFEST

7
test/bad_syntax.lv2/bad_syntax.c

@ -57,6 +57,11 @@ instantiate(const LV2_Descriptor* descriptor,
const char* path,
const LV2_Feature* const* features)
{
(void)descriptor;
(void)rate;
(void)path;
(void)features;
Test* test = (Test*)calloc(1, sizeof(Test));
if (!test) {
return NULL;
@ -68,6 +73,8 @@ instantiate(const LV2_Descriptor* descriptor,
static void
run(LV2_Handle instance, uint32_t sample_count)
{
(void)sample_count;
Test* test = (Test*)instance;
*test->output = *test->input;

20
test/failed_instantiation.lv2/failed_instantiation.c

@ -31,11 +31,17 @@ typedef struct {
static void
cleanup(LV2_Handle instance)
{}
{
(void)instance;
}
static void
connect_port(LV2_Handle instance, uint32_t port, void* data)
{}
{
(void)instance;
(void)port;
(void)data;
}
static LV2_Handle
instantiate(const LV2_Descriptor* descriptor,
@ -43,12 +49,20 @@ instantiate(const LV2_Descriptor* descriptor,
const char* path,
const LV2_Feature* const* features)
{
(void)descriptor;
(void)rate;
(void)path;
(void)features;
return NULL;
}
static void
run(LV2_Handle instance, uint32_t sample_count)
{}
{
(void)instance;
(void)sample_count;
}
static const LV2_Descriptor descriptor = {
PLUGIN_URI,

3
test/failed_lib_descriptor.lv2/failed_lib_descriptor.c

@ -23,5 +23,8 @@ LV2_SYMBOL_EXPORT
const LV2_Lib_Descriptor*
lv2_lib_descriptor(const char* bundle_path, const LV2_Feature* const* features)
{
(void)bundle_path;
(void)features;
return NULL;
}

12
test/lib_descriptor.lv2/lib_descriptor.c

@ -57,6 +57,11 @@ instantiate(const LV2_Descriptor* descriptor,
const char* path,
const LV2_Feature* const* features)
{
(void)descriptor;
(void)rate;
(void)path;
(void)features;
Test* test = (Test*)calloc(1, sizeof(Test));
if (!test) {
return NULL;
@ -68,6 +73,8 @@ instantiate(const LV2_Descriptor* descriptor,
static void
run(LV2_Handle instance, uint32_t sample_count)
{
(void)sample_count;
Test* test = (Test*)instance;
*test->output = *test->input;
@ -87,6 +94,8 @@ static const LV2_Descriptor descriptor = {
static const LV2_Descriptor*
get_plugin(LV2_Lib_Handle handle, uint32_t index)
{
(void)handle;
switch (index) {
case 0:
return &descriptor;
@ -104,5 +113,8 @@ LV2_SYMBOL_EXPORT
const LV2_Lib_Descriptor*
lv2_lib_descriptor(const char* bundle_path, const LV2_Feature* const* features)
{
(void)bundle_path;
(void)features;
return &lib;
}

7
test/missing_name.lv2/missing_name.c

@ -57,6 +57,11 @@ instantiate(const LV2_Descriptor* descriptor,
const char* path,
const LV2_Feature* const* features)
{
(void)descriptor;
(void)rate;
(void)path;
(void)features;
Test* test = (Test*)calloc(1, sizeof(Test));
if (!test) {
return NULL;
@ -68,6 +73,8 @@ instantiate(const LV2_Descriptor* descriptor,
static void
run(LV2_Handle instance, uint32_t sample_count)
{
(void)sample_count;
Test* test = (Test*)instance;
*test->output = *test->input;

7
test/missing_port.lv2/missing_port.c

@ -57,6 +57,11 @@ instantiate(const LV2_Descriptor* descriptor,
const char* path,
const LV2_Feature* const* features)
{
(void)descriptor;
(void)rate;
(void)path;
(void)features;
Test* test = (Test*)calloc(1, sizeof(Test));
if (!test) {
return NULL;
@ -68,6 +73,8 @@ instantiate(const LV2_Descriptor* descriptor,
static void
run(LV2_Handle instance, uint32_t sample_count)
{
(void)sample_count;
Test* test = (Test*)instance;
*test->output = *test->input;

7
test/missing_port_name.lv2/missing_port_name.c

@ -57,6 +57,11 @@ instantiate(const LV2_Descriptor* descriptor,
const char* path,
const LV2_Feature* const* features)
{
(void)descriptor;
(void)rate;
(void)path;
(void)features;
Test* test = (Test*)calloc(1, sizeof(Test));
if (!test) {
return NULL;
@ -68,6 +73,8 @@ instantiate(const LV2_Descriptor* descriptor,
static void
run(LV2_Handle instance, uint32_t sample_count)
{
(void)sample_count;
Test* test = (Test*)instance;
*test->output = *test->input;

7
test/new_version.lv2/new_version.c

@ -57,6 +57,11 @@ instantiate(const LV2_Descriptor* descriptor,
const char* path,
const LV2_Feature* const* features)
{
(void)descriptor;
(void)rate;
(void)path;
(void)features;
Test* test = (Test*)calloc(1, sizeof(Test));
if (!test) {
return NULL;
@ -68,6 +73,8 @@ instantiate(const LV2_Descriptor* descriptor,
static void
run(LV2_Handle instance, uint32_t sample_count)
{
(void)sample_count;
Test* test = (Test*)instance;
*test->output = *test->input;

7
test/old_version.lv2/old_version.c

@ -57,6 +57,11 @@ instantiate(const LV2_Descriptor* descriptor,
const char* path,
const LV2_Feature* const* features)
{
(void)descriptor;
(void)rate;
(void)path;
(void)features;
Test* test = (Test*)calloc(1, sizeof(Test));
if (!test) {
return NULL;
@ -68,6 +73,8 @@ instantiate(const LV2_Descriptor* descriptor,
static void
run(LV2_Handle instance, uint32_t sample_count)
{
(void)sample_count;
Test* test = (Test*)instance;
*test->output = *test->input;

8
test/test.lv2/test.c

@ -95,6 +95,10 @@ instantiate(const LV2_Descriptor* descriptor,
const char* path,
const LV2_Feature* const* features)
{
(void)descriptor;
(void)rate;
(void)path;
Test* test = (Test*)calloc(1, sizeof(Test));
if (!test) {
return NULL;
@ -171,6 +175,8 @@ save(LV2_Handle instance,
uint32_t flags,
const LV2_Feature* const* features)
{
(void)flags;
Test* plugin = (Test*)instance;
LV2_State_Map_Path* map_path = NULL;
@ -329,6 +335,8 @@ restore(LV2_Handle instance,
uint32_t flags,
const LV2_Feature* const* features)
{
(void)flags;
Test* plugin = (Test*)instance;
LV2_State_Map_Path* map_path = NULL;

2
test/test_filesystem.c

@ -401,6 +401,8 @@ typedef struct {
static void
visit(const char* const path, const char* const name, void* const data)
{
(void)path;
FileList* file_list = (FileList*)data;
file_list->names =

16
test/test_state.c

@ -155,6 +155,8 @@ no_test_directories(void)
static void
remove_file(const char* path, const char* name, void* data)
{
(void)data;
char* const full_path = lilv_path_join(path, name);
assert(!lilv_remove(full_path));
free(full_path);
@ -215,6 +217,9 @@ set_port_value(const char* port_symbol,
uint32_t size,
uint32_t type)
{
(void)size;
(void)type;
TestContext* ctx = (TestContext*)user_data;
if (!strcmp(port_symbol, "input")) {
@ -535,6 +540,14 @@ count_sink(void* const handle,
const SerdNode* const object_datatype,
const SerdNode* const object_lang)
{
(void)flags;
(void)graph;
(void)subject;
(void)predicate;
(void)object;
(void)object_datatype;
(void)object_lang;
size_t* const n_statements = (size_t*)handle;
++(*n_statements);
@ -1009,6 +1022,9 @@ test_bad_subject(void)
static void
count_file(const char* path, const char* name, void* data)
{
(void)path;
(void)name;
*(unsigned*)data += 1;
}

2
utils/lilv-bench.c

@ -17,7 +17,7 @@
#include "lilv/lilv.h"
int
main(int argc, char** argv)
main(void)
{
LilvWorld* world = lilv_world_new();
lilv_world_load_all(world);

2
wscript

@ -147,7 +147,6 @@ def configure(conf):
'-Wno-shorten-64-to-32',
'-Wno-sign-conversion',
'-Wno-switch-enum',
'-Wno-unused-parameter',
'-Wno-vla',
],
'gcc': [
@ -161,7 +160,6 @@ def configure(conf):
'-Wno-suggest-attribute=const',
'-Wno-suggest-attribute=pure',
'-Wno-switch-enum',
'-Wno-unused-parameter',
'-Wno-vla',
],
'msvc': [

Loading…
Cancel
Save