From 170655ef0433652ed4d93bb45bbc7810be57b7e0 Mon Sep 17 00:00:00 2001
From: Aaron Cuevas Lopez <aacuelo@teleco.upv.es>
Date: Tue, 30 May 2017 04:04:36 +0200
Subject: [PATCH] Fix some compiler warnings

---
 Source/Processors/Channel/InfoObjects.cpp      | 18 ++++++++++++++++++
 Source/Processors/Channel/InfoObjects.h        | 12 +++++++++---
 Source/Processors/Channel/MetaData.cpp         |  8 +++++++-
 Source/Processors/Channel/MetaData.h           |  4 ++++
 .../DataThreads/RhythmNode/RHD2000Thread.cpp   |  1 +
 .../GenericProcessor/GenericProcessor.cpp      |  4 ++--
 6 files changed, 41 insertions(+), 6 deletions(-)

diff --git a/Source/Processors/Channel/InfoObjects.cpp b/Source/Processors/Channel/InfoObjects.cpp
index 4e33c8e2e..fe6a1302b 100644
--- a/Source/Processors/Channel/InfoObjects.cpp
+++ b/Source/Processors/Channel/InfoObjects.cpp
@@ -34,12 +34,18 @@ NodeInfoBase::NodeInfoBase(uint16 id) :
 	m_nodeID(id)
 {}
 
+NodeInfoBase::~NodeInfoBase()
+{}
+
 unsigned int NodeInfoBase::getCurrentNodeID() const
 {
 	return m_nodeID;
 }
 
 //History Object
+HistoryObject::~HistoryObject()
+{}
+
 String HistoryObject::getHistoricString()
 {
 	return m_historicString;
@@ -62,6 +68,9 @@ SourceProcessorInfo::SourceProcessorInfo(const GenericProcessor* source, uint16
 {
 }
 
+SourceProcessorInfo::~SourceProcessorInfo()
+{}
+
 uint16 SourceProcessorInfo::getSourceNodeID() const
 {
 	return m_sourceNodeID;
@@ -83,6 +92,9 @@ String SourceProcessorInfo::getSourceName() const
 }
 
 //NamedInfoObject
+NamedInfoObject::~NamedInfoObject()
+{}
+
 void NamedInfoObject::setName(String name)
 {
 	m_name = name;
@@ -123,6 +135,9 @@ InfoObjectCommon::InfoObjectCommon(uint16 idx, uint16 typeidx, float sampleRate,
 {
 }
 
+InfoObjectCommon::~InfoObjectCommon()
+{}
+
 float InfoObjectCommon::getSampleRate() const
 {
 	return m_sampleRate;
@@ -526,6 +541,9 @@ ConfigurationObject::ConfigurationObject(String identifier, GenericProcessor* so
 	setIdentifier(identifier);
 }
 
+ConfigurationObject::~ConfigurationObject()
+{}
+
 void ConfigurationObject::setShouldBeRecorded(bool status)
 {
 	m_shouldBeRecorded = status;
diff --git a/Source/Processors/Channel/InfoObjects.h b/Source/Processors/Channel/InfoObjects.h
index c16e3d117..a9c44fd9f 100644
--- a/Source/Processors/Channel/InfoObjects.h
+++ b/Source/Processors/Channel/InfoObjects.h
@@ -47,6 +47,7 @@ class PLUGIN_API NodeInfoBase
 	//This field should never be changed by anything except GenericProcessor base code
 	friend class GenericProcessor;
 public:
+    virtual ~NodeInfoBase();
 	/** Gets the ID of the processor which currently owns this copy of the info object */
 	unsigned int getCurrentNodeID() const;
 protected:
@@ -62,6 +63,7 @@ protected:
 	HistoryObject();
 
 public:
+    virtual ~HistoryObject();
 	/** Returns the historic string */
 	String getHistoricString();
 	/** Adds a new entry in the historic string*/
@@ -77,6 +79,7 @@ protected:
 	SourceProcessorInfo(const GenericProcessor* source, uint16 subproc = 0);
 
 public:
+    virtual ~SourceProcessorInfo();
 	/** Gets the ID of the processor which created the channel object */
 	uint16 getSourceNodeID() const;
 
@@ -101,6 +104,7 @@ private:
 class PLUGIN_API NamedInfoObject
 {
 public:
+    virtual ~NamedInfoObject();
 	/** Sets the object's name*/
 	void setName(String name);
 
@@ -135,6 +139,7 @@ protected:
 	InfoObjectCommon(uint16 idx, uint16 typeidx, float sampleRate, const GenericProcessor* source, uint16 subproc = 0);
 
 public:
+    virtual ~InfoObjectCommon();
 	enum InfoObjectType
 	{
 		DATA_CHANNEL,
@@ -191,7 +196,7 @@ public:
 	/** Copy constructor. */
 	DataChannel(const DataChannel& ch);
 
-	~DataChannel();
+	virtual ~DataChannel();
 
 	//--------- DATA GET / SET METHODS --------//
 
@@ -293,7 +298,7 @@ public:
 	*/
 	EventChannel(EventChannelTypes type, unsigned int numChannels, unsigned int dataLength, float sampleRate, GenericProcessor* source, uint16 subproc = 0);
 
-	~EventChannel();
+	virtual ~EventChannel();
 
 	EventChannelTypes getChannelType() const;
 
@@ -358,7 +363,7 @@ public:
 	*/
 	SpikeChannel(ElectrodeTypes type, GenericProcessor* source, const Array<const DataChannel*>& sourceChannels, uint16 subproc = 0);
 
-	~SpikeChannel();
+	virtual ~SpikeChannel();
 
 	ElectrodeTypes getChannelType() const;
 
@@ -421,6 +426,7 @@ public:
 	@param subproc Optional. The source subprocessor index
 	*/
 	ConfigurationObject(String identifier, GenericProcessor* source, uint16 subproc = 0);
+    virtual ~ConfigurationObject();
 
 	/** Sets if the configuration should be recorded or not.
 	Similar to the events, this does not prevent the configuration data to be recorded, but rather states
diff --git a/Source/Processors/Channel/MetaData.cpp b/Source/Processors/Channel/MetaData.cpp
index c2d297959..5945ebd9f 100644
--- a/Source/Processors/Channel/MetaData.cpp
+++ b/Source/Processors/Channel/MetaData.cpp
@@ -46,7 +46,7 @@ bool checkMetaDataType(MetaDataDescriptor::MetaDataTypes baseType)
 //MetaDataDescriptor
 
 MetaDataDescriptor::MetaDataDescriptor(MetaDataDescriptor::MetaDataTypes t, unsigned int length, String n, String d, String id)
-	: m_name(n), m_description(d), m_identifier(id), m_type(t), m_length(length)
+	: m_name(n), m_identifier(id), m_description(d), m_type(t), m_length(length)
 {}
 
 MetaDataDescriptor::~MetaDataDescriptor() {};
@@ -264,6 +264,8 @@ void MetaDataValue::setValue(const void* data)
 
 MetaDataInfoObject::MetaDataInfoObject() {}
 
+MetaDataInfoObject::~MetaDataInfoObject() {}
+
 void MetaDataInfoObject::addMetaData(MetaDataDescriptor* desc, MetaDataValue* val)
 {
 	if (desc->getType() != val->getDataType() || desc->getLength() != val->getDataLength())
@@ -322,6 +324,8 @@ int MetaDataInfoObject::findMetaData(MetaDataDescriptor::MetaDataTypes type, uns
 
 MetaDataEventObject::MetaDataEventObject() {}
 
+MetaDataEventObject::~MetaDataEventObject() {}
+
 void MetaDataEventObject::addEventMetaData(MetaDataDescriptor* desc)
 {
 	if (eventMetaDataLock)
@@ -376,6 +380,8 @@ int MetaDataEventObject::findEventMetaData(MetaDataDescriptor::MetaDataTypes typ
 //MetaDataEvent
 MetaDataEvent::MetaDataEvent() {}
 
+MetaDataEvent::~MetaDataEvent() {}
+
 void MetaDataEvent::serializeMetaData(void* dstBuffer) const
 {
 	int metaDataSize = m_metaDataValues.size();
diff --git a/Source/Processors/Channel/MetaData.h b/Source/Processors/Channel/MetaData.h
index b3677b5ce..0c799cd76 100644
--- a/Source/Processors/Channel/MetaData.h
+++ b/Source/Processors/Channel/MetaData.h
@@ -172,6 +172,7 @@ class PLUGIN_API MetaDataInfoObject
 protected:
 	MetaDataInfoObject();
 public:
+    virtual ~MetaDataInfoObject();
 	void addMetaData(MetaDataDescriptor* desc, MetaDataValue* val);
 	void addMetaData(const MetaDataDescriptor& desc, const MetaDataValue& val);
 	const MetaDataDescriptor* getMetaDataDescriptor(int index) const;
@@ -199,6 +200,7 @@ protected:
 class PLUGIN_API MetaDataEventObject : public MetaDataEventLock
 {
 public:
+    virtual ~MetaDataEventObject();
 	//This method will only work when creating the info object, but not for those copied down the chain
 	void addEventMetaData(MetaDataDescriptor* desc);
 	void addEventMetaData(const MetaDataDescriptor& desc);
@@ -215,6 +217,8 @@ protected:
 //And the base from which event objects can hold their metadata before serializing
 class PLUGIN_API MetaDataEvent
 {
+public:
+    virtual ~MetaDataEvent();
 protected:
 	void serializeMetaData(void* dstBuffer) const;
 	bool deserializeMetaData(const MetaDataEventObject* info, const void* srcBuffer, int size);
diff --git a/Source/Processors/DataThreads/RhythmNode/RHD2000Thread.cpp b/Source/Processors/DataThreads/RhythmNode/RHD2000Thread.cpp
index 326b8951d..bbd62617f 100644
--- a/Source/Processors/DataThreads/RhythmNode/RHD2000Thread.cpp
+++ b/Source/Processors/DataThreads/RhythmNode/RHD2000Thread.cpp
@@ -927,6 +927,7 @@ int RHD2000Thread::getNumDataOutputs(DataChannel::DataChannelTypes type, int sub
 			return 0;
 		}
 	}
+    return 0;
 }
 
 String RHD2000Thread::getChannelUnits(int chanIndex) const
diff --git a/Source/Processors/GenericProcessor/GenericProcessor.cpp b/Source/Processors/GenericProcessor/GenericProcessor.cpp
index e1b6864a8..b82fc4225 100755
--- a/Source/Processors/GenericProcessor/GenericProcessor.cpp
+++ b/Source/Processors/GenericProcessor/GenericProcessor.cpp
@@ -465,7 +465,7 @@ void GenericProcessor::createEventChannels()
 		int nChans = events.size();
 		for (int i = 0; i < nChans; i++)
 		{
-			DefaultEventInfo& info = events[i];
+			const DefaultEventInfo& info = events[i];
 			if (info.type != EventChannel::INVALID && info.nChannels > 0 && info.length > 0)
 			{
 				EventChannel* chan = new EventChannel(info.type, info.nChannels, info.length, info.sampleRate, this, sub);
@@ -1251,7 +1251,7 @@ GenericProcessor::DefaultEventInfo::DefaultEventInfo()
 
 uint32 GenericProcessor::getProcessorFullId(uint16 sid, uint16 subid)
 {
-	return uint32(sid) << 16 + subid;
+	return (uint32(sid) << 16) + subid;
 }
 
 int64 GenericProcessor::getLastProcessedsoftwareTime() const
-- 
GitLab