diff options
author | David Robillard <d@drobilla.net> | 2008-11-27 22:25:02 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-11-27 22:25:02 +0000 |
commit | cb1d3b65670febd0bd5c3ac7d128f45ef0a744a4 (patch) | |
tree | f80d319e213f18578d0af8c6e288e73ff1ebef0f | |
parent | 08fc813198f67daf7ef6278c5d54b12fb63decc1 (diff) | |
download | ingen-cb1d3b65670febd0bd5c3ac7d128f45ef0a744a4.tar.gz ingen-cb1d3b65670febd0bd5c3ac7d128f45ef0a744a4.tar.bz2 ingen-cb1d3b65670febd0bd5c3ac7d128f45ef0a744a4.zip |
Fix warnings for non-debug builds.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1804 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | src/engine/LADSPAPlugin.cpp | 12 | ||||
-rw-r--r-- | src/engine/NodeFactory.cpp | 17 |
2 files changed, 20 insertions, 9 deletions
diff --git a/src/engine/LADSPAPlugin.cpp b/src/engine/LADSPAPlugin.cpp index 4a0b5c14..38db3164 100644 --- a/src/engine/LADSPAPlugin.cpp +++ b/src/engine/LADSPAPlugin.cpp @@ -40,21 +40,27 @@ LADSPAPlugin::instantiate(const string& name, SampleCount srate = engine.audio_driver()->sample_rate(); SampleCount buffer_size = engine.audio_driver()->buffer_size(); - LADSPA_Descriptor_Function df = NULL; + union { + void* dp; + LADSPA_Descriptor_Function fp; + } df; + df.dp = NULL; + df.fp = NULL; + LADSPANode* n = NULL; load(); // FIXME: unload at some point assert(_module); assert(*_module); - if (!_module->get_symbol("ladspa_descriptor", (void*&)df)) { + if (!_module->get_symbol("ladspa_descriptor", df.dp)) { cerr << "Looks like this isn't a LADSPA plugin." << endl; return NULL; } // Attempt to find the plugin in library LADSPA_Descriptor* descriptor = NULL; - for (unsigned long i=0; (descriptor = (LADSPA_Descriptor*)df(i)) != NULL; ++i) { + for (unsigned long i=0; (descriptor = (LADSPA_Descriptor*)df.fp(i)) != NULL; ++i) { if (descriptor->UniqueID == _id) { break; } diff --git a/src/engine/NodeFactory.cpp b/src/engine/NodeFactory.cpp index e75f6605..0d15907b 100644 --- a/src/engine/NodeFactory.cpp +++ b/src/engine/NodeFactory.cpp @@ -221,9 +221,14 @@ NodeFactory::load_ladspa_plugins() struct dirent* pfile; while ((pfile = readdir(pdir))) { - - LADSPA_Descriptor_Function df = NULL; - LADSPA_Descriptor* descriptor = NULL; + union { + void* dp; + LADSPA_Descriptor_Function fp; + } df; + df.dp = NULL; + df.fp = NULL; + + LADSPA_Descriptor* descriptor = NULL; if (!strcmp(pfile->d_name, ".") || !strcmp(pfile->d_name, "..")) continue; @@ -240,8 +245,8 @@ NodeFactory::load_ladspa_plugins() if (!plugin_library || !(*plugin_library)) continue; - bool found = plugin_library->get_symbol("ladspa_descriptor", (void*&)df); - if (!found || !df) { + bool found = plugin_library->get_symbol("ladspa_descriptor", df.dp); + if (!found || !df.dp) { cerr << "WARNING: Non-LADSPA library found in LADSPA path: " << lib_path << endl; // Not a LADSPA plugin library @@ -249,7 +254,7 @@ NodeFactory::load_ladspa_plugins() continue; } - for (unsigned long i=0; (descriptor = (LADSPA_Descriptor*)df(i)) != NULL; ++i) { + for (unsigned long i=0; (descriptor = (LADSPA_Descriptor*)df.fp(i)) != NULL; ++i) { char id_str[11]; snprintf(id_str, 11, "%lu", descriptor->UniqueID); const string uri = string("ladspa:").append(id_str); |