diff options
author | Torbjörn Andersson | 2010-01-03 19:37:43 +0000 |
---|---|---|
committer | Torbjörn Andersson | 2010-01-03 19:37:43 +0000 |
commit | 72eb9ec9eab5efcb3aa99a962a80423e8c0a3232 (patch) | |
tree | 032c9107838aefca6a166465a46fa7318bb82566 /backends/keymapper | |
parent | 910ffb53a0b6c74a965df9a1270cdfc3885252ec (diff) | |
download | scummvm-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 'backends/keymapper')
-rw-r--r-- | backends/keymapper/keymap.cpp | 14 | ||||
-rw-r--r-- | backends/keymapper/keymapper.cpp | 2 | ||||
-rw-r--r-- | backends/keymapper/remap-dialog.cpp | 6 |
3 files changed, 11 insertions, 11 deletions
diff --git a/backends/keymapper/keymap.cpp b/backends/keymapper/keymap.cpp index 1c0d8528f2..93581c622d 100644 --- a/backends/keymapper/keymap.cpp +++ b/backends/keymapper/keymap.cpp @@ -36,7 +36,7 @@ namespace Common { Keymap::Keymap(const Keymap& km) : _actions(km._actions), _keymap(), _configDomain(0) { List<Action*>::iterator it; - for (it = _actions.begin(); it != _actions.end(); it++) { + for (it = _actions.begin(); it != _actions.end(); ++it) { const HardwareKey *hwKey = (*it)->getMappedKey(); if (hwKey) { @@ -48,7 +48,7 @@ Keymap::Keymap(const Keymap& km) : _actions(km._actions), _keymap(), _configDoma Keymap::~Keymap() { List<Action*>::iterator it; - for (it = _actions.begin(); it != _actions.end(); it++) + for (it = _actions.begin(); it != _actions.end(); ++it) delete *it; } @@ -87,7 +87,7 @@ Action *Keymap::getAction(const char *id) { Action *Keymap::findAction(const char *id) { List<Action*>::iterator it; - for (it = _actions.begin(); it != _actions.end(); it++) { + for (it = _actions.begin(); it != _actions.end(); ++it) { if (strncmp((*it)->id, id, ACTION_ID_SIZE) == 0) return *it; } @@ -97,7 +97,7 @@ Action *Keymap::findAction(const char *id) { const Action *Keymap::findAction(const char *id) const { List<Action*>::const_iterator it; - for (it = _actions.begin(); it != _actions.end(); it++) { + for (it = _actions.begin(); it != _actions.end(); ++it) { if (strncmp((*it)->id, id, ACTION_ID_SIZE) == 0) return *it; } @@ -127,7 +127,7 @@ void Keymap::loadMappings(const HardwareKeySet *hwKeys) { ConfigManager::Domain::iterator it; String prefix = KEYMAP_KEY_PREFIX + _name + "_"; - for (it = _configDomain->begin(); it != _configDomain->end(); it++) { + for (it = _configDomain->begin(); it != _configDomain->end(); ++it) { const String& key = it->_key; if (!key.hasPrefix(prefix.c_str())) @@ -164,7 +164,7 @@ void Keymap::saveMappings() { List<Action*>::const_iterator it; String prefix = KEYMAP_KEY_PREFIX + _name + "_"; - for (it = _actions.begin(); it != _actions.end(); it++) { + for (it = _actions.begin(); it != _actions.end(); ++it) { uint actIdLen = strlen((*it)->id); actIdLen = (actIdLen > ACTION_ID_SIZE) ? ACTION_ID_SIZE : actIdLen; @@ -186,7 +186,7 @@ bool Keymap::isComplete(const HardwareKeySet *hwKeys) { bool allMapped = true; uint numberMapped = 0; - for (it = _actions.begin(); it != _actions.end(); it++) { + for (it = _actions.begin(); it != _actions.end(); ++it) { if ((*it)->getMappedKey()) { numberMapped++; } else { diff --git a/backends/keymapper/keymapper.cpp b/backends/keymapper/keymapper.cpp index df1facf1c1..557900adc1 100644 --- a/backends/keymapper/keymapper.cpp +++ b/backends/keymapper/keymapper.cpp @@ -41,7 +41,7 @@ void Keymapper::Domain::addKeymap(Keymap *map) { } void Keymapper::Domain::deleteAllKeyMaps() { - for (iterator it = begin(); it != end(); it++) + for (iterator it = begin(); it != end(); ++it) delete it->_value; clear(); diff --git a/backends/keymapper/remap-dialog.cpp b/backends/keymapper/remap-dialog.cpp index 850f25c4a3..cd6ca1237a 100644 --- a/backends/keymapper/remap-dialog.cpp +++ b/backends/keymapper/remap-dialog.cpp @@ -94,7 +94,7 @@ void RemapDialog::open() { if (_globalKeymaps) { if (divider) _kmPopUp->appendEntry(""); - for (it = _globalKeymaps->begin(); it != _globalKeymaps->end(); it++) { + for (it = _globalKeymaps->begin(); it != _globalKeymaps->end(); ++it) { _kmPopUp->appendEntry(it->_value->getName() + " (Global)", idx); _keymapTable[idx++] = it->_value; } @@ -104,7 +104,7 @@ void RemapDialog::open() { if (_gameKeymaps) { if (divider) _kmPopUp->appendEntry(""); - for (it = _gameKeymaps->begin(); it != _gameKeymaps->end(); it++) { + for (it = _gameKeymaps->begin(); it != _gameKeymaps->end(); ++it) { _kmPopUp->appendEntry(it->_value->getName() + " (Game)", idx); _keymapTable[idx++] = it->_value; } @@ -317,7 +317,7 @@ void RemapDialog::loadKeymap() { List<Action*>::iterator it; - for (it = km->getActions().begin(); it != km->getActions().end(); it++) { + for (it = km->getActions().begin(); it != km->getActions().end(); ++it) { ActionInfo info = {*it, false, (*it)->description}; _currentActions.push_back(info); |