From 48184679086094cc5d6067de8c31a6823fc71732 Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Fri, 22 Jan 2010 19:05:02 +0000 Subject: 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 --- backends/platform/PalmOS/Src/base_mouse.cpp | 7 ++----- backends/platform/psp/powerman.cpp | 4 ++-- backends/platform/wii/osystem_gfx.cpp | 3 +-- backends/platform/wince/CEgui/GUIElement.cpp | 3 +-- backends/platform/wince/CEgui/ItemSwitch.cpp | 3 +-- backends/platform/wince/missing/missing.cpp | 6 ++---- 6 files changed, 9 insertions(+), 17 deletions(-) (limited to 'backends/platform') 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::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::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; } -- cgit v1.2.3