changeset 134:767ead1cee18

plugins/: unused attribute only for gcc
author Paul Brossier <piem@piem.org>
date Fri, 22 Jul 2016 12:19:06 +0200
parents f8518e1e57e3
children 538a54fdfb44
files plugins/MelEnergy.cpp plugins/Mfcc.cpp plugins/SpecDesc.cpp plugins/Types.h
diffstat 4 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/MelEnergy.cpp	Fri Jul 22 12:03:08 2016 +0200
+++ b/plugins/MelEnergy.cpp	Fri Jul 22 12:19:06 2016 +0200
@@ -197,7 +197,7 @@
 
 MelEnergy::FeatureSet
 MelEnergy::process(const float *const *inputBuffers,
-               __attribute__((unused)) Vamp::RealTime timestamp)
+               UNUSED Vamp::RealTime timestamp)
 {
     FeatureSet returnFeatures;
 
--- a/plugins/Mfcc.cpp	Fri Jul 22 12:03:08 2016 +0200
+++ b/plugins/Mfcc.cpp	Fri Jul 22 12:19:06 2016 +0200
@@ -208,7 +208,7 @@
 
 Mfcc::FeatureSet
 Mfcc::process(const float *const *inputBuffers,
-               __attribute__((unused)) Vamp::RealTime timestamp)
+               UNUSED Vamp::RealTime timestamp)
 {
     FeatureSet returnFeatures;
 
--- a/plugins/SpecDesc.cpp	Fri Jul 22 12:03:08 2016 +0200
+++ b/plugins/SpecDesc.cpp	Fri Jul 22 12:19:06 2016 +0200
@@ -205,7 +205,7 @@
 
 SpecDesc::FeatureSet
 SpecDesc::process(const float *const *inputBuffers,
-               __attribute__((unused)) Vamp::RealTime timestamp)
+               UNUSED Vamp::RealTime timestamp)
 {
     for (size_t i = 0; i < m_stepSize; ++i) {
         fvec_set_sample(m_ibuf, inputBuffers[0][i], i);
--- a/plugins/Types.h	Fri Jul 22 12:03:08 2016 +0200
+++ b/plugins/Types.h	Fri Jul 22 12:19:06 2016 +0200
@@ -26,6 +26,13 @@
 #ifndef _ONSET_TYPE_H_
 #define _ONSET_TYPE_H_
 
+/** silence unused parameter warning by adding an attribute */
+#if defined(__GNUC__)
+#define UNUSED __attribute__((unused))
+#else
+#define UNUSED
+#endif
+
 // Note: the enum values in this header are ordered to match the Vamp
 // plugin parameter values in earlier versions of this plugin set, to
 // avoid breaking stored parameter settings that use the parameter's