Skip to content

Commit 170655e

Browse files
committed
Fix some compiler warnings
1 parent 226bfab commit 170655e

6 files changed

Lines changed: 41 additions & 6 deletions

File tree

Source/Processors/Channel/InfoObjects.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,18 @@ NodeInfoBase::NodeInfoBase(uint16 id) :
3434
m_nodeID(id)
3535
{}
3636

37+
NodeInfoBase::~NodeInfoBase()
38+
{}
39+
3740
unsigned int NodeInfoBase::getCurrentNodeID() const
3841
{
3942
return m_nodeID;
4043
}
4144

4245
//History Object
46+
HistoryObject::~HistoryObject()
47+
{}
48+
4349
String HistoryObject::getHistoricString()
4450
{
4551
return m_historicString;
@@ -62,6 +68,9 @@ SourceProcessorInfo::SourceProcessorInfo(const GenericProcessor* source, uint16
6268
{
6369
}
6470

71+
SourceProcessorInfo::~SourceProcessorInfo()
72+
{}
73+
6574
uint16 SourceProcessorInfo::getSourceNodeID() const
6675
{
6776
return m_sourceNodeID;
@@ -83,6 +92,9 @@ String SourceProcessorInfo::getSourceName() const
8392
}
8493

8594
//NamedInfoObject
95+
NamedInfoObject::~NamedInfoObject()
96+
{}
97+
8698
void NamedInfoObject::setName(String name)
8799
{
88100
m_name = name;
@@ -123,6 +135,9 @@ InfoObjectCommon::InfoObjectCommon(uint16 idx, uint16 typeidx, float sampleRate,
123135
{
124136
}
125137

138+
InfoObjectCommon::~InfoObjectCommon()
139+
{}
140+
126141
float InfoObjectCommon::getSampleRate() const
127142
{
128143
return m_sampleRate;
@@ -526,6 +541,9 @@ ConfigurationObject::ConfigurationObject(String identifier, GenericProcessor* so
526541
setIdentifier(identifier);
527542
}
528543

544+
ConfigurationObject::~ConfigurationObject()
545+
{}
546+
529547
void ConfigurationObject::setShouldBeRecorded(bool status)
530548
{
531549
m_shouldBeRecorded = status;

Source/Processors/Channel/InfoObjects.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ class PLUGIN_API NodeInfoBase
4747
//This field should never be changed by anything except GenericProcessor base code
4848
friend class GenericProcessor;
4949
public:
50+
virtual ~NodeInfoBase();
5051
/** Gets the ID of the processor which currently owns this copy of the info object */
5152
unsigned int getCurrentNodeID() const;
5253
protected:
@@ -62,6 +63,7 @@ class PLUGIN_API HistoryObject
6263
HistoryObject();
6364

6465
public:
66+
virtual ~HistoryObject();
6567
/** Returns the historic string */
6668
String getHistoricString();
6769
/** Adds a new entry in the historic string*/
@@ -77,6 +79,7 @@ class PLUGIN_API SourceProcessorInfo
7779
SourceProcessorInfo(const GenericProcessor* source, uint16 subproc = 0);
7880

7981
public:
82+
virtual ~SourceProcessorInfo();
8083
/** Gets the ID of the processor which created the channel object */
8184
uint16 getSourceNodeID() const;
8285

@@ -101,6 +104,7 @@ class PLUGIN_API SourceProcessorInfo
101104
class PLUGIN_API NamedInfoObject
102105
{
103106
public:
107+
virtual ~NamedInfoObject();
104108
/** Sets the object's name*/
105109
void setName(String name);
106110

@@ -135,6 +139,7 @@ class PLUGIN_API InfoObjectCommon :
135139
InfoObjectCommon(uint16 idx, uint16 typeidx, float sampleRate, const GenericProcessor* source, uint16 subproc = 0);
136140

137141
public:
142+
virtual ~InfoObjectCommon();
138143
enum InfoObjectType
139144
{
140145
DATA_CHANNEL,
@@ -191,7 +196,7 @@ class PLUGIN_API DataChannel
191196
/** Copy constructor. */
192197
DataChannel(const DataChannel& ch);
193198

194-
~DataChannel();
199+
virtual ~DataChannel();
195200

196201
//--------- DATA GET / SET METHODS --------//
197202

@@ -293,7 +298,7 @@ class PLUGIN_API EventChannel :
293298
*/
294299
EventChannel(EventChannelTypes type, unsigned int numChannels, unsigned int dataLength, float sampleRate, GenericProcessor* source, uint16 subproc = 0);
295300

296-
~EventChannel();
301+
virtual ~EventChannel();
297302

298303
EventChannelTypes getChannelType() const;
299304

@@ -358,7 +363,7 @@ class PLUGIN_API SpikeChannel :
358363
*/
359364
SpikeChannel(ElectrodeTypes type, GenericProcessor* source, const Array<const DataChannel*>& sourceChannels, uint16 subproc = 0);
360365

361-
~SpikeChannel();
366+
virtual ~SpikeChannel();
362367

363368
ElectrodeTypes getChannelType() const;
364369

@@ -421,6 +426,7 @@ class PLUGIN_API ConfigurationObject :
421426
@param subproc Optional. The source subprocessor index
422427
*/
423428
ConfigurationObject(String identifier, GenericProcessor* source, uint16 subproc = 0);
429+
virtual ~ConfigurationObject();
424430

425431
/** Sets if the configuration should be recorded or not.
426432
Similar to the events, this does not prevent the configuration data to be recorded, but rather states

Source/Processors/Channel/MetaData.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ bool checkMetaDataType(MetaDataDescriptor::MetaDataTypes baseType)
4646
//MetaDataDescriptor
4747

4848
MetaDataDescriptor::MetaDataDescriptor(MetaDataDescriptor::MetaDataTypes t, unsigned int length, String n, String d, String id)
49-
: m_name(n), m_description(d), m_identifier(id), m_type(t), m_length(length)
49+
: m_name(n), m_identifier(id), m_description(d), m_type(t), m_length(length)
5050
{}
5151

5252
MetaDataDescriptor::~MetaDataDescriptor() {};
@@ -264,6 +264,8 @@ void MetaDataValue::setValue(const void* data)
264264

265265
MetaDataInfoObject::MetaDataInfoObject() {}
266266

267+
MetaDataInfoObject::~MetaDataInfoObject() {}
268+
267269
void MetaDataInfoObject::addMetaData(MetaDataDescriptor* desc, MetaDataValue* val)
268270
{
269271
if (desc->getType() != val->getDataType() || desc->getLength() != val->getDataLength())
@@ -322,6 +324,8 @@ int MetaDataInfoObject::findMetaData(MetaDataDescriptor::MetaDataTypes type, uns
322324

323325
MetaDataEventObject::MetaDataEventObject() {}
324326

327+
MetaDataEventObject::~MetaDataEventObject() {}
328+
325329
void MetaDataEventObject::addEventMetaData(MetaDataDescriptor* desc)
326330
{
327331
if (eventMetaDataLock)
@@ -376,6 +380,8 @@ int MetaDataEventObject::findEventMetaData(MetaDataDescriptor::MetaDataTypes typ
376380
//MetaDataEvent
377381
MetaDataEvent::MetaDataEvent() {}
378382

383+
MetaDataEvent::~MetaDataEvent() {}
384+
379385
void MetaDataEvent::serializeMetaData(void* dstBuffer) const
380386
{
381387
int metaDataSize = m_metaDataValues.size();

Source/Processors/Channel/MetaData.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ class PLUGIN_API MetaDataInfoObject
172172
protected:
173173
MetaDataInfoObject();
174174
public:
175+
virtual ~MetaDataInfoObject();
175176
void addMetaData(MetaDataDescriptor* desc, MetaDataValue* val);
176177
void addMetaData(const MetaDataDescriptor& desc, const MetaDataValue& val);
177178
const MetaDataDescriptor* getMetaDataDescriptor(int index) const;
@@ -199,6 +200,7 @@ class PLUGIN_API MetaDataEventLock
199200
class PLUGIN_API MetaDataEventObject : public MetaDataEventLock
200201
{
201202
public:
203+
virtual ~MetaDataEventObject();
202204
//This method will only work when creating the info object, but not for those copied down the chain
203205
void addEventMetaData(MetaDataDescriptor* desc);
204206
void addEventMetaData(const MetaDataDescriptor& desc);
@@ -215,6 +217,8 @@ class PLUGIN_API MetaDataEventObject : public MetaDataEventLock
215217
//And the base from which event objects can hold their metadata before serializing
216218
class PLUGIN_API MetaDataEvent
217219
{
220+
public:
221+
virtual ~MetaDataEvent();
218222
protected:
219223
void serializeMetaData(void* dstBuffer) const;
220224
bool deserializeMetaData(const MetaDataEventObject* info, const void* srcBuffer, int size);

Source/Processors/DataThreads/RhythmNode/RHD2000Thread.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,7 @@ int RHD2000Thread::getNumDataOutputs(DataChannel::DataChannelTypes type, int sub
927927
return 0;
928928
}
929929
}
930+
return 0;
930931
}
931932

932933
String RHD2000Thread::getChannelUnits(int chanIndex) const

Source/Processors/GenericProcessor/GenericProcessor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@ void GenericProcessor::createEventChannels()
465465
int nChans = events.size();
466466
for (int i = 0; i < nChans; i++)
467467
{
468-
DefaultEventInfo& info = events[i];
468+
const DefaultEventInfo& info = events[i];
469469
if (info.type != EventChannel::INVALID && info.nChannels > 0 && info.length > 0)
470470
{
471471
EventChannel* chan = new EventChannel(info.type, info.nChannels, info.length, info.sampleRate, this, sub);
@@ -1251,7 +1251,7 @@ GenericProcessor::DefaultEventInfo::DefaultEventInfo()
12511251

12521252
uint32 GenericProcessor::getProcessorFullId(uint16 sid, uint16 subid)
12531253
{
1254-
return uint32(sid) << 16 + subid;
1254+
return (uint32(sid) << 16) + subid;
12551255
}
12561256

12571257
int64 GenericProcessor::getLastProcessedsoftwareTime() const

0 commit comments

Comments
 (0)