aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2010-01-21 23:05:33 +0000
committerTorbjörn Andersson2010-01-21 23:05:33 +0000
commit1928a7ba38bed50b2342fa0946538b6dc5330755 (patch)
treef00a042f11e56e422b47f7555fb29bd75c04ccfa
parent8257b1106cf8c037c56ee855edc3d8dd32d12dd8 (diff)
downloadscummvm-rg350-1928a7ba38bed50b2342fa0946538b6dc5330755.tar.gz
scummvm-rg350-1928a7ba38bed50b2342fa0946538b6dc5330755.tar.bz2
scummvm-rg350-1928a7ba38bed50b2342fa0946538b6dc5330755.zip
Silenced some cppcheck warnings.
svn-id: r47427
-rw-r--r--base/plugins.cpp2
-rw-r--r--engines/agi/console.cpp2
-rw-r--r--engines/agi/sound.cpp18
-rw-r--r--engines/agi/wagparser.cpp2
-rw-r--r--engines/parallaction/debug.cpp6
-rw-r--r--engines/saga/saveload.cpp2
-rw-r--r--engines/sword2/sprite.cpp5
7 files changed, 20 insertions, 17 deletions
diff --git a/base/plugins.cpp b/base/plugins.cpp
index 5291dd02a4..c68fd7c461 100644
--- a/base/plugins.cpp
+++ b/base/plugins.cpp
@@ -234,7 +234,7 @@ PluginList FilePluginProvider::getPlugins() {
pluginDirs.push_back(Common::FSNode(pluginsPath));
Common::FSList::const_iterator dir;
- for (dir = pluginDirs.begin(); dir != pluginDirs.end(); dir++) {
+ for (dir = pluginDirs.begin(); dir != pluginDirs.end(); ++dir) {
// Load all plugins.
// Scan for all plugins in this directory
Common::FSList files;
diff --git a/engines/agi/console.cpp b/engines/agi/console.cpp
index e093445087..a0621f80dd 100644
--- a/engines/agi/console.cpp
+++ b/engines/agi/console.cpp
@@ -257,7 +257,7 @@ bool Console::Cmd_BT(int argc, const char **argv) {
int num;
Common::Array<ScriptPos>::iterator it;
- for (it = _vm->_game.execStack.begin(); it != _vm->_game.execStack.end(); it++) {
+ for (it = _vm->_game.execStack.begin(); it != _vm->_game.execStack.end(); ++it) {
code = _vm->_game.logics[it->script].data;
op = code[it->curIP];
num = logicNamesCmd[op].numArgs;
diff --git a/engines/agi/sound.cpp b/engines/agi/sound.cpp
index 53777d4dd2..35360eebc4 100644
--- a/engines/agi/sound.cpp
+++ b/engines/agi/sound.cpp
@@ -428,7 +428,7 @@ void SoundMgr::stopSound() {
void IIgsSoundMgr::stopSounds() {
// Stops all sounds on all MIDI channels
- for (iterator iter = _midiChannels.begin(); iter != _midiChannels.end(); iter++)
+ for (iterator iter = _midiChannels.begin(); iter != _midiChannels.end(); ++iter)
iter->stopSounds();
}
@@ -445,7 +445,7 @@ bool IIgsSoundMgr::playSampleSound(const IIgsSampleHeader &sampleHeader, const i
void IIgsMidiChannel::stopSounds() {
// Stops all sounds on this single MIDI channel
- for (iterator iter = _gsChannels.begin(); iter != _gsChannels.end(); iter++)
+ for (iterator iter = _gsChannels.begin(); iter != _gsChannels.end(); ++iter)
iter->stop();
_gsChannels.clear();
@@ -690,7 +690,7 @@ void IIgsSoundMgr::setProgramChangeMapping(const MidiProgramChangeMapping *mappi
}
void IIgsSoundMgr::removeStoppedSounds() {
- for (Common::Array<IIgsMidiChannel>::iterator iter = _midiChannels.begin(); iter != _midiChannels.end(); iter++)
+ for (Common::Array<IIgsMidiChannel>::iterator iter = _midiChannels.begin(); iter != _midiChannels.end(); ++iter)
iter->removeStoppedSounds();
}
@@ -703,7 +703,7 @@ void IIgsMidiChannel::removeStoppedSounds() {
uint IIgsSoundMgr::activeSounds() const {
uint result = 0;
- for (Common::Array<IIgsMidiChannel>::const_iterator iter = _midiChannels.begin(); iter != _midiChannels.end(); iter++)
+ for (Common::Array<IIgsMidiChannel>::const_iterator iter = _midiChannels.begin(); iter != _midiChannels.end(); ++iter)
result += iter->activeSounds();
return result;
@@ -712,7 +712,7 @@ uint IIgsSoundMgr::activeSounds() const {
uint IIgsMidiChannel::activeSounds() const {
uint result = 0;
- for (const_iterator iter = _gsChannels.begin(); iter != _gsChannels.end(); iter++)
+ for (const_iterator iter = _gsChannels.begin(); iter != _gsChannels.end(); ++iter)
if (!iter->end)
result++;
@@ -724,7 +724,7 @@ void IIgsMidiChannel::setInstrument(const IIgsInstrumentHeader *instrument, cons
_sample = sample;
// Set program on each Apple IIGS channel playing on this MIDI channel
- for (iterator iter = _gsChannels.begin(); iter != _gsChannels.end(); iter++)
+ for (iterator iter = _gsChannels.begin(); iter != _gsChannels.end(); ++iter)
iter->setInstrument(instrument, sample);
}
@@ -732,14 +732,14 @@ void IIgsMidiChannel::setVolume(uint8 volume) {
_volume = volume;
// Set volume on each Apple IIGS channel playing on this MIDI channel
- for (iterator iter = _gsChannels.begin(); iter != _gsChannels.end(); iter++)
+ for (iterator iter = _gsChannels.begin(); iter != _gsChannels.end(); ++iter)
iter->setChannelVolume(volume);
}
void IIgsMidiChannel::noteOff(uint8 note, uint8 velocity) {
// Go through all the notes playing on this MIDI channel
// and turn off the ones that are playing the given note
- for (iterator iter = _gsChannels.begin(); iter != _gsChannels.end(); iter++)
+ for (iterator iter = _gsChannels.begin(); iter != _gsChannels.end(); ++iter)
if (iter->origNote == note)
iter->noteOff(velocity);
}
@@ -1195,7 +1195,7 @@ struct fsnodeNameEqualsIgnoreCase : public Common::UnaryFunction<const Common::F
fsnodeNameEqualsIgnoreCase(const Common::StringList &str) : _str(str) {}
fsnodeNameEqualsIgnoreCase(const Common::String str) { _str.push_back(str); }
bool operator()(const Common::FSNode &param) const {
- for (Common::StringList::const_iterator iter = _str.begin(); iter != _str.end(); iter++)
+ for (Common::StringList::const_iterator iter = _str.begin(); iter != _str.end(); ++iter)
if (param.getName().equalsIgnoreCase(*iter))
return true;
return false;
diff --git a/engines/agi/wagparser.cpp b/engines/agi/wagparser.cpp
index d243439dff..1d60524070 100644
--- a/engines/agi/wagparser.cpp
+++ b/engines/agi/wagparser.cpp
@@ -213,7 +213,7 @@ bool WagFileParser::parse(const Common::FSNode &node) {
}
const WagProperty *WagFileParser::getProperty(const WagProperty::WagPropertyCode code) const {
- for (PropertyList::const_iterator iter = _propList.begin(); iter != _propList.end(); iter++)
+ for (PropertyList::const_iterator iter = _propList.begin(); iter != _propList.end(); ++iter)
if (iter->getCode() == code) return iter;
return NULL;
}
diff --git a/engines/parallaction/debug.cpp b/engines/parallaction/debug.cpp
index 4cdd7f989e..8864c84e2f 100644
--- a/engines/parallaction/debug.cpp
+++ b/engines/parallaction/debug.cpp
@@ -158,7 +158,7 @@ bool Debugger::Cmd_Zones(int argc, const char **argv) {
DebugPrintf("+--------------------+---+---+---+---+--------+--------+\n"
"| name | l | t | r | b | type | flag |\n"
"+--------------------+---+---+---+---+--------+--------+\n");
- for ( ; b != e; b++) {
+ for ( ; b != e; ++b) {
ZonePtr z = *b;
z->getRect(r);
DebugPrintf("|%-20s|%3i|%3i|%3i|%3i|%8x|%8x|\n", z->_name, r.left, r.top, r.right, r.bottom, z->_type, z->_flags );
@@ -237,7 +237,7 @@ bool Debugger::Cmd_Animations(int argc, const char **argv) {
DebugPrintf("+--------------------+----+----+----+---+--------+----------------------------------------+\n"
"| name | x | y | z | f | type | flags | \n"
"+--------------------+----+----+----+---+--------+----------------------------------------+\n");
- for ( ; b != e; b++) {
+ for ( ; b != e; ++b) {
AnimationPtr a = *b;
flags = decodeZoneFlags(a->_flags);
DebugPrintf("|%-20s|%4i|%4i|%4i|%3i|%8x|%-40s|\n", a->_name, a->getX(), a->getY(), a->getZ(), a->getF(), a->_type, flags.c_str() );
@@ -260,7 +260,7 @@ bool Debugger::Cmd_GfxObjects(int argc, const char **argv) {
GfxObjArray::iterator e = _vm->_gfx->_sceneObjects.end();
Common::Rect r;
- for ( ; b != e; b++) {
+ for ( ; b != e; ++b) {
GfxObj *obj = *b;
obj->getRect(obj->frame, r);
DebugPrintf("|%-20s|%5i|%5i|%5i|%5i|%5i|%7i|%5i|%8s|\n", obj->getName(), r.left, r.top, r.width(), r.height(),
diff --git a/engines/saga/saveload.cpp b/engines/saga/saveload.cpp
index 8dfbd3e9f2..9ef5c40c02 100644
--- a/engines/saga/saveload.cpp
+++ b/engines/saga/saveload.cpp
@@ -136,7 +136,7 @@ void SagaEngine::fillSaveList() {
_saveFilesCount = 0;
- for (Common::StringList::iterator file = filenames.begin(); file != filenames.end(); file++){
+ for (Common::StringList::iterator file = filenames.begin(); file != filenames.end(); ++file){
//Obtain the last 2 digits of the filename, since they correspond to the save slot
slot[0] = file->c_str()[file->size()-2];
slot[1] = file->c_str()[file->size()-1];
diff --git a/engines/sword2/sprite.cpp b/engines/sword2/sprite.cpp
index 3d40c2b858..13dad5c414 100644
--- a/engines/sword2/sprite.cpp
+++ b/engines/sword2/sprite.cpp
@@ -538,8 +538,11 @@ int32 Screen::drawSprite(SpriteInfo *s) {
unwindRaw16(tempBuf2, tempBuf, (s->w * (s->h / 2)), s->colourTable);
sprite = (byte *)malloc(s->w * s->h);
- if (!sprite)
+ if (!sprite) {
+ free(tempBuf2);
+ free(tempBuf);
return RDERR_OUTOFMEMORY;
+ }
resizePsxSprite(sprite, tempBuf2, s->w, s->h);