summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2009-04-08 23:29:21 +0200
committerBjørn Lindeijer <bjorn@lindeijer.nl>2009-04-09 22:51:37 +0200
commitdefb43bcd7dd1b3a475214bb3c36cb44bf16358f (patch)
tree40930c6d2e0f83723d230657b1250c600162c5ee
parent69d8407badcb703709534f5097b9b5697ac3404c (diff)
downloadmana-defb43bcd7dd1b3a475214bb3c36cb44bf16358f.tar.gz
mana-defb43bcd7dd1b3a475214bb3c36cb44bf16358f.tar.bz2
mana-defb43bcd7dd1b3a475214bb3c36cb44bf16358f.tar.xz
mana-defb43bcd7dd1b3a475214bb3c36cb44bf16358f.zip
Fixed some warnings
Unused variable, compiler suggested braces to disambiguate an else statement and another comparision between signed and unsigned integers.
-rw-r--r--src/gui/widgets/chattab.cpp3
-rw-r--r--src/main.cpp2
-rw-r--r--src/resources/wallpaper.cpp17
3 files changed, 16 insertions, 6 deletions
diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp
index f3258f04..1879a918 100644
--- a/src/gui/widgets/chattab.cpp
+++ b/src/gui/widgets/chattab.cpp
@@ -215,7 +215,8 @@ void ChatTab::chatInput(std::string &msg)
{
trim(msg);
- if (msg.empty()) return;
+ if (msg.empty())
+ return;
// Check for item link
std::string::size_type start = msg.find('[');
diff --git a/src/main.cpp b/src/main.cpp
index 0ef7289a..d113f3e4 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -967,7 +967,7 @@ int main(int argc, char *argv[])
#ifdef TMWSERV_SUPPORT
Net::initialize();
- TmwServ::GeneralHandler *generalHandler = new TmwServ::GeneralHandler;
+ new TmwServ::GeneralHandler; // Currently registers itself
#else
SDLNet_Init();
Network *network = new Network;
diff --git a/src/resources/wallpaper.cpp b/src/resources/wallpaper.cpp
index 24c6fff2..2c8c4a00 100644
--- a/src/resources/wallpaper.cpp
+++ b/src/resources/wallpaper.cpp
@@ -54,26 +54,35 @@ void Wallpaper::loadWallpapers()
{
char **imgs = PHYSFS_enumerateFiles(WALLPAPER_FOLDER);
char **i;
- int baseLen = strlen(WALLPAPER_BASE), width, height;
+ size_t baseLen = strlen(WALLPAPER_BASE);
+ int width;
+ int height;
wallpapers.clear();
haveBackup = false;
for (i = imgs; *i != NULL; i++)
+ {
if (strncmp(*i, WALLPAPER_BASE, baseLen) == 0)
+ {
if (strlen(*i) == baseLen + 4)
+ {
if (haveBackup)
logger->log("Duplicate default wallpaper!");
- else haveBackup = true;
- else if (sscanf(*i, WALLPAPER_BASE "_%dx%d.png", &width,
- &height) == 2)
+ else
+ haveBackup = true;
+ }
+ else if (sscanf(*i, WALLPAPER_BASE "_%dx%d.png",
+ &width, &height) == 2)
{
struct wallpaper wp;
wp.width = width;
wp.height = height;
wallpapers.push_back(wp);
}
+ }
+ }
PHYSFS_freeList(imgs);