From 020e59f28530ee2ee72f3567981fa7bff7b8e89b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 9 Aug 2012 01:41:00 +0000 Subject: Fix warnings: -Wshadow -Wpointer-arith -Wcast-align -Wstrict-prototypes -Wmissing-prototypes. Fix broken suil_wrapper_new prototypes discovered by the above. git-svn-id: http://svn.drobilla.net/lad/trunk/suil@4630 a436a847-0d15-0410-975c-d299462d15a1 --- src/gtk2_in_qt4.cpp | 3 ++- src/qt4_in_gtk2.cpp | 3 ++- src/suil_internal.h | 18 +++++++++++++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/gtk2_in_qt4.cpp b/src/gtk2_in_qt4.cpp index bb58dfb..35d1f3c 100644 --- a/src/gtk2_in_qt4.cpp +++ b/src/gtk2_in_qt4.cpp @@ -78,7 +78,8 @@ SuilWrapper* suil_wrapper_new(SuilHost* host, const char* host_type_uri, const char* ui_type_uri, - LV2_Feature*** features) + LV2_Feature*** features, + unsigned n_features) { /* We have to open libgtk here, so Gtk type symbols are present and will be found by the introspection stuff. This is required at least to make diff --git a/src/qt4_in_gtk2.cpp b/src/qt4_in_gtk2.cpp index 4722413..c04e25c 100644 --- a/src/qt4_in_gtk2.cpp +++ b/src/qt4_in_gtk2.cpp @@ -133,7 +133,8 @@ SuilWrapper* suil_wrapper_new(SuilHost* host, const char* host_type_uri, const char* ui_type_uri, - LV2_Feature*** features) + LV2_Feature*** features, + unsigned n_features) { SuilWrapper* wrapper = (SuilWrapper*)malloc(sizeof(SuilWrapper)); wrapper->wrap = wrapper_wrap; diff --git a/src/suil_internal.h b/src/suil_internal.h index 0e565cb..b72c545 100644 --- a/src/suil_internal.h +++ b/src/suil_internal.h @@ -37,6 +37,10 @@ static inline char* dlerror(void) { return "Unknown error"; } #include "suil/suil.h" +#ifdef __cplusplus +extern "C" { +#endif + #define SUIL_ERRORF(fmt, ...) fprintf(stderr, "suil error: " fmt, __VA_ARGS__) struct SuilHostImpl { @@ -89,7 +93,15 @@ typedef SuilWrapper* (*SuilWrapperNewFunc)(SuilHost* host, LV2_Feature*** features, unsigned n_features); -typedef void (*SuilVoidFunc)(); +/** Prototype for suil_wrapper_new in each module. */ +SuilWrapper* +suil_wrapper_new(SuilHost* host, + const char* host_type_uri, + const char* ui_type_uri, + LV2_Feature*** features, + unsigned n_features); + +typedef void (*SuilVoidFunc)(void); /** dlsym wrapper to return a function pointer (without annoying warning) */ static inline SuilVoidFunc @@ -124,4 +136,8 @@ suil_add_feature(LV2_Feature*** features, *n += 1; } +#ifdef __cplusplus +} /* extern "C" */ +#endif + #endif // SUIL_INTERNAL_H -- cgit v1.2.1