aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorTorbjörn Andersson2010-01-22 19:05:02 +0000
committerTorbjörn Andersson2010-01-22 19:05:02 +0000
commit48184679086094cc5d6067de8c31a6823fc71732 (patch)
treedd366cf38861efbf803aa194e455577efcea8871 /backends
parent8f41cc0631914a6a743a1efa5275d8fa399b4f12 (diff)
downloadscummvm-rg350-48184679086094cc5d6067de8c31a6823fc71732.tar.gz
scummvm-rg350-48184679086094cc5d6067de8c31a6823fc71732.tar.bz2
scummvm-rg350-48184679086094cc5d6067de8c31a6823fc71732.zip
Silenced some more cppcheck warnings. Some of these may seem silly, but the way
I figure it the changes are harmless at worst, and making them will make it easier to find real errors in the (still quite long) list of warnings. svn-id: r47443
Diffstat (limited to 'backends')
-rw-r--r--backends/platform/PalmOS/Src/base_mouse.cpp7
-rw-r--r--backends/platform/psp/powerman.cpp4
-rw-r--r--backends/platform/wii/osystem_gfx.cpp3
-rw-r--r--backends/platform/wince/CEgui/GUIElement.cpp3
-rw-r--r--backends/platform/wince/CEgui/ItemSwitch.cpp3
-rw-r--r--backends/platform/wince/missing/missing.cpp6
-rw-r--r--backends/vkeybd/image-map.cpp4
-rw-r--r--backends/vkeybd/virtual-keyboard.cpp4
8 files changed, 13 insertions, 21 deletions
diff --git a/backends/platform/PalmOS/Src/base_mouse.cpp b/backends/platform/PalmOS/Src/base_mouse.cpp
index 93a1fd2209..053a0ed3a7 100644
--- a/backends/platform/PalmOS/Src/base_mouse.cpp
+++ b/backends/platform/PalmOS/Src/base_mouse.cpp
@@ -55,11 +55,8 @@ void OSystem_PalmBase::setMouseCursor(const byte *buf, uint w, uint h, int hotsp
_mouseCurState.w = w;
_mouseCurState.h = h;
- if (_mouseDataP)
- free(_mouseDataP);
-
- if (_mouseBackupP)
- free(_mouseBackupP);
+ free(_mouseDataP);
+ free(_mouseBackupP);
_mouseDataP = (byte *)malloc(w * h);
_mouseBackupP = (byte *)malloc(w * h * 2); // if 16bit = *2
diff --git a/backends/platform/psp/powerman.cpp b/backends/platform/psp/powerman.cpp
index 678f3697fb..89741f3fc9 100644
--- a/backends/platform/psp/powerman.cpp
+++ b/backends/platform/psp/powerman.cpp
@@ -359,7 +359,7 @@ int PowerManager::suspend() {
// Iterate
Common::List<Suspendable *>::iterator i = _suspendList.begin();
- for (; i != _suspendList.end(); i++) {
+ for (; i != _suspendList.end(); ++i) {
(*i)->suspend();
}
@@ -402,7 +402,7 @@ int PowerManager::resume() {
// Iterate
Common::List<Suspendable *>::iterator i = _suspendList.begin();
- for (; i != _suspendList.end(); i++) {
+ for (; i != _suspendList.end(); ++i) {
(*i)->resume();
}
diff --git a/backends/platform/wii/osystem_gfx.cpp b/backends/platform/wii/osystem_gfx.cpp
index 13ad3267bf..f1d3e255e2 100644
--- a/backends/platform/wii/osystem_gfx.cpp
+++ b/backends/platform/wii/osystem_gfx.cpp
@@ -258,8 +258,7 @@ void OSystem_Wii::initSize(uint width, uint height,
}
if (update) {
- if (_gamePixels)
- free(_gamePixels);
+ free(_gamePixels);
tex_format = GFX_TF_PALETTE_RGB565;
diff --git a/backends/platform/wince/CEgui/GUIElement.cpp b/backends/platform/wince/CEgui/GUIElement.cpp
index a37182e69d..23e7843de1 100644
--- a/backends/platform/wince/CEgui/GUIElement.cpp
+++ b/backends/platform/wince/CEgui/GUIElement.cpp
@@ -120,8 +120,7 @@ namespace CEGUI {
}
GUIElement::~GUIElement() {
- if (_background)
- delete _background;
+ delete _background;
}
}
diff --git a/backends/platform/wince/CEgui/ItemSwitch.cpp b/backends/platform/wince/CEgui/ItemSwitch.cpp
index 445b3bb69b..8e0121f7c4 100644
--- a/backends/platform/wince/CEgui/ItemSwitch.cpp
+++ b/backends/platform/wince/CEgui/ItemSwitch.cpp
@@ -57,8 +57,7 @@ namespace CEGUI {
}
ItemSwitch::~ItemSwitch() {
- if (_backgroundFalse)
- delete _backgroundFalse;
+ delete _backgroundFalse;
}
bool ItemSwitch::action(int x, int y, bool pushed) {
diff --git a/backends/platform/wince/missing/missing.cpp b/backends/platform/wince/missing/missing.cpp
index 2d9765b0f2..532f1d2e89 100644
--- a/backends/platform/wince/missing/missing.cpp
+++ b/backends/platform/wince/missing/missing.cpp
@@ -288,8 +288,7 @@ struct dirent* readdir(DIR* dir) {
}
WideCharToMultiByte(CP_ACP, 0, wfd.cFileName, -1, nameFound, MAX_PATH, NULL, NULL);
- if (dir->dd_dir.d_name)
- free(dir->dd_dir.d_name);
+ free(dir->dd_dir.d_name);
dir->dd_dir.d_name = strdup(nameFound);
dir->dd_dir.d_namlen = strlen(nameFound);
@@ -307,8 +306,7 @@ int closedir(DIR* dir) {
if (dir->dd_handle)
FindClose((HANDLE)dir->dd_handle);
- if (dir->dd_dir.d_name)
- free(dir->dd_dir.d_name);
+ free(dir->dd_dir.d_name);
free(dir);
return 1;
}
diff --git a/backends/vkeybd/image-map.cpp b/backends/vkeybd/image-map.cpp
index b0aa42ba22..36d060e1d4 100644
--- a/backends/vkeybd/image-map.cpp
+++ b/backends/vkeybd/image-map.cpp
@@ -53,7 +53,7 @@ void ImageMap::removeArea(const String& id) {
void ImageMap::removeAllAreas() {
HashMap<String, Polygon*>::iterator it;
- for (it = _areas.begin(); it != _areas.end(); it++) {
+ for (it = _areas.begin(); it != _areas.end(); ++it) {
delete it->_value;
}
_areas.clear();
@@ -61,7 +61,7 @@ void ImageMap::removeAllAreas() {
String ImageMap::findMapArea(int16 x, int16 y) {
HashMap<String, Polygon*>::iterator it;
- for (it = _areas.begin(); it != _areas.end(); it++) {
+ for (it = _areas.begin(); it != _areas.end(); ++it) {
if (it->_value->contains(x, y))
return it->_key;
}
diff --git a/backends/vkeybd/virtual-keyboard.cpp b/backends/vkeybd/virtual-keyboard.cpp
index 20709ad89f..ed78f9a67c 100644
--- a/backends/vkeybd/virtual-keyboard.cpp
+++ b/backends/vkeybd/virtual-keyboard.cpp
@@ -58,9 +58,9 @@ VirtualKeyboard::~VirtualKeyboard() {
void VirtualKeyboard::deleteEvents() {
ModeMap::iterator it_m;
VKEventMap::iterator it_e;
- for (it_m = _modes.begin(); it_m != _modes.end(); it_m++) {
+ for (it_m = _modes.begin(); it_m != _modes.end(); ++it_m) {
VKEventMap *evt = &(it_m->_value.events);
- for (it_e = evt->begin(); it_e != evt->end(); it_e++)
+ for (it_e = evt->begin(); it_e != evt->end(); ++it_e)
delete it_e->_value;
}
}