aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorTorbjörn Andersson2010-01-03 19:37:43 +0000
committerTorbjörn Andersson2010-01-03 19:37:43 +0000
commit72eb9ec9eab5efcb3aa99a962a80423e8c0a3232 (patch)
tree032c9107838aefca6a166465a46fa7318bb82566 /sound
parent910ffb53a0b6c74a965df9a1270cdfc3885252ec (diff)
downloadscummvm-rg350-72eb9ec9eab5efcb3aa99a962a80423e8c0a3232.tar.gz
scummvm-rg350-72eb9ec9eab5efcb3aa99a962a80423e8c0a3232.tar.bz2
scummvm-rg350-72eb9ec9eab5efcb3aa99a962a80423e8c0a3232.zip
Fixed a bunch of cppcheck warnings. Mostly about checking if a pointer is null
before freeing it, which isn't necessary. svn-id: r46941
Diffstat (limited to 'sound')
-rw-r--r--sound/midiparser_smf.cpp3
-rw-r--r--sound/mods/infogrames.cpp9
-rw-r--r--sound/softsynth/mt32.cpp3
-rw-r--r--sound/softsynth/mt32/synth.cpp3
4 files changed, 6 insertions, 12 deletions
diff --git a/sound/midiparser_smf.cpp b/sound/midiparser_smf.cpp
index 89b7d3f525..4261b1d770 100644
--- a/sound/midiparser_smf.cpp
+++ b/sound/midiparser_smf.cpp
@@ -52,8 +52,7 @@ static const byte command_lengths[8] = { 3, 3, 3, 3, 2, 2, 3, 0 };
static const byte special_lengths[16] = { 0, 2, 3, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0 };
MidiParser_SMF::~MidiParser_SMF() {
- if (_buffer)
- free(_buffer);
+ free(_buffer);
}
void MidiParser_SMF::property(int prop, int value) {
diff --git a/sound/mods/infogrames.cpp b/sound/mods/infogrames.cpp
index 9d3d6b8562..c2631dc079 100644
--- a/sound/mods/infogrames.cpp
+++ b/sound/mods/infogrames.cpp
@@ -34,8 +34,7 @@ Infogrames::Instruments::Instruments() {
}
Infogrames::Instruments::~Instruments() {
- if (_sampleData)
- delete[] _sampleData;
+ delete[] _sampleData;
}
void Infogrames::Instruments::init() {
@@ -104,8 +103,7 @@ bool Infogrames::Instruments::load(Common::SeekableReadStream &ins) {
}
void Infogrames::Instruments::unload() {
- if (_sampleData)
- delete[] _sampleData;
+ delete[] _sampleData;
init();
}
@@ -142,8 +140,7 @@ Infogrames::Infogrames(Instruments &ins, bool stereo, int rate,
}
Infogrames::~Infogrames() {
- if (_data)
- delete[] _data;
+ delete[] _data;
}
void Infogrames::init() {
diff --git a/sound/softsynth/mt32.cpp b/sound/softsynth/mt32.cpp
index dde6b4f559..654aca9294 100644
--- a/sound/softsynth/mt32.cpp
+++ b/sound/softsynth/mt32.cpp
@@ -248,8 +248,7 @@ MidiDriver_MT32::MidiDriver_MT32(Audio::Mixer *mixer) : MidiDriver_Emulated(mixe
}
MidiDriver_MT32::~MidiDriver_MT32() {
- if (_synth != NULL)
- delete _synth;
+ delete _synth;
}
int MidiDriver_MT32::open() {
diff --git a/sound/softsynth/mt32/synth.cpp b/sound/softsynth/mt32/synth.cpp
index 0f0d15686c..b3f8d81719 100644
--- a/sound/softsynth/mt32/synth.cpp
+++ b/sound/softsynth/mt32/synth.cpp
@@ -129,8 +129,7 @@ void Synth::printDebug(const char *fmt, ...) {
void Synth::initReverb(Bit8u newRevMode, Bit8u newRevTime, Bit8u newRevLevel) {
// FIXME:KG: I don't think it's necessary to recreate the reverbModel... Just set the parameters
- if (reverbModel != NULL)
- delete reverbModel;
+ delete reverbModel;
reverbModel = new revmodel();
switch (newRevMode) {