changeset 398:7d59dd1ba5de

Add -Wextra, fix a couple of warnings it throws up
author Chris Cannam
date Tue, 16 Jun 2015 10:54:54 +0100
parents 14b34e85523b
children 86b9f817223a
files Makefile.in configure configure.ac examples/FixedTempoEstimator.cpp examples/PowerSpectrum.cpp examples/SpectralCentroid.cpp src/vamp-sdk/PluginAdapter.cpp
diffstat 7 files changed, 13 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile.in	Tue Jun 16 10:26:12 2015 +0100
+++ b/Makefile.in	Tue Jun 16 10:54:54 2015 +0100
@@ -138,6 +138,7 @@
 		$(HOSTSDKDIR)/PluginSummarisingAdapter.h \
 		$(HOSTSDKDIR)/PluginWrapper.h \
 		$(HOSTSDKDIR)/hostguard.h \
+		$(HOSTSDKDIR)/host-c.h \
 		$(HOSTSDKDIR)/vamp-hostsdk.h
 
 SDK_OBJECTS	= \
@@ -155,6 +156,7 @@
 		$(HOSTSDKSRCDIR)/PluginLoader.o \
 		$(HOSTSDKSRCDIR)/PluginSummarisingAdapter.o \
 		$(HOSTSDKSRCDIR)/PluginWrapper.o \
+		$(HOSTSDKSRCDIR)/host-c.o \
 		$(HOSTSDKSRCDIR)/acsymbols.o
 
 SDK_STATIC	= \
--- a/configure	Tue Jun 16 10:26:12 2015 +0100
+++ b/configure	Tue Jun 16 10:54:54 2015 +0100
@@ -3950,11 +3950,11 @@
 if test "x$GCC" = "xyes"; then
   case " $CXXFLAGS " in
     *[\ \	]-fPIC\ -Wall[\ \	]*) ;;
-    *) CXXFLAGS="$CXXFLAGS -fPIC -Wall" ;;
+    *) CXXFLAGS="$CXXFLAGS -fPIC -Wall -Wextra" ;;
   esac
   case " $CFLAGS " in
     *[\ \	]-fPIC\ -Wall[\ \	]*) ;;
-    *) CFLAGS="$CFLAGS -fPIC -Wall" ;;
+    *) CFLAGS="$CFLAGS -fPIC -Wall -Wextra" ;;
   esac
 fi
 
--- a/configure.ac	Tue Jun 16 10:26:12 2015 +0100
+++ b/configure.ac	Tue Jun 16 10:54:54 2015 +0100
@@ -44,11 +44,11 @@
 if test "x$GCC" = "xyes"; then
   case " $CXXFLAGS " in
     *[\ \	]-fPIC\ -Wall[\ \	]*) ;;
-    *) CXXFLAGS="$CXXFLAGS -fPIC -Wall" ;;
+    *) CXXFLAGS="$CXXFLAGS -fPIC -Wall -Wextra" ;;
   esac
   case " $CFLAGS " in
     *[\ \	]-fPIC\ -Wall[\ \	]*) ;;
-    *) CFLAGS="$CFLAGS -fPIC -Wall" ;;
+    *) CFLAGS="$CFLAGS -fPIC -Wall -Wextra" ;;
   esac
 fi
 changequote([,])dnl
--- a/examples/FixedTempoEstimator.cpp	Tue Jun 16 10:26:12 2015 +0100
+++ b/examples/FixedTempoEstimator.cpp	Tue Jun 16 10:54:54 2015 +0100
@@ -431,7 +431,7 @@
 
             if (k0 >= 0 && k0 < int(n/2)) {
 
-                int kmax = 0, kmin = 0;
+                int kmax = 0;
                 float kvmax = 0, kvmin = 0;
                 bool have = false;
 
@@ -439,8 +439,8 @@
 
                     if (k < 0 || k >= n/2) continue;
 
-                    if (!have || (m_r[k] > kvmax)) { kmax = k; kvmax = m_r[k]; }
-                    if (!have || (m_r[k] < kvmin)) { kmin = k; kvmin = m_r[k]; }
+                    if (!have || (m_r[k] > kvmax)) { kvmax = m_r[k]; kmax = k; }
+                    if (!have || (m_r[k] < kvmin)) { kvmin = m_r[k]; }
                     
                     have = true;
                 }
--- a/examples/PowerSpectrum.cpp	Tue Jun 16 10:26:12 2015 +0100
+++ b/examples/PowerSpectrum.cpp	Tue Jun 16 10:54:54 2015 +0100
@@ -89,7 +89,7 @@
 }
 
 bool
-PowerSpectrum::initialise(size_t channels, size_t stepSize, size_t blockSize)
+PowerSpectrum::initialise(size_t channels, size_t, size_t blockSize)
 {
     if (channels < getMinChannelCount() ||
 	channels > getMaxChannelCount()) return false;
@@ -133,7 +133,7 @@
 }
 
 PowerSpectrum::FeatureSet
-PowerSpectrum::process(const float *const *inputBuffers, Vamp::RealTime timestamp)
+PowerSpectrum::process(const float *const *inputBuffers, Vamp::RealTime)
 {
     FeatureSet fs;
 
--- a/examples/SpectralCentroid.cpp	Tue Jun 16 10:26:12 2015 +0100
+++ b/examples/SpectralCentroid.cpp	Tue Jun 16 10:54:54 2015 +0100
@@ -143,7 +143,7 @@
 }
 
 SpectralCentroid::FeatureSet
-SpectralCentroid::process(const float *const *inputBuffers, Vamp::RealTime timestamp)
+SpectralCentroid::process(const float *const *inputBuffers, Vamp::RealTime)
 {
     if (m_stepSize == 0) {
 	cerr << "ERROR: SpectralCentroid::process: "
--- a/src/vamp-sdk/PluginAdapter.cpp	Tue Jun 16 10:26:12 2015 +0100
+++ b/src/vamp-sdk/PluginAdapter.cpp	Tue Jun 16 10:54:54 2015 +0100
@@ -588,7 +588,7 @@
 }
 
 void
-PluginAdapterBase::Impl::vampReleaseFeatureSet(VampFeatureList *fs)
+PluginAdapterBase::Impl::vampReleaseFeatureSet(VampFeatureList *)
 {
 #ifdef DEBUG_PLUGIN_ADAPTER
     std::cerr << "PluginAdapterBase::Impl::vampReleaseFeatureSet" << std::endl;