summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-01-21 02:38:18 +0300
committerAndrei Karas <akaras@inbox.ru>2012-01-21 02:38:18 +0300
commitdaf84780d386ee122ae4b4bd37b1e918f93fb202 (patch)
treef967cbbf8de1e36aa8c48a556938ef5bf1a9cab9
parent98dabed4de60bc86522632379f2499aecbae2b70 (diff)
downloadplus-daf84780d386ee122ae4b4bd37b1e918f93fb202.tar.gz
plus-daf84780d386ee122ae4b4bd37b1e918f93fb202.tar.bz2
plus-daf84780d386ee122ae4b4bd37b1e918f93fb202.tar.xz
plus-daf84780d386ee122ae4b4bd37b1e918f93fb202.zip
Fix more warnings.
-rwxr-xr-xbuild/bmakesnapshot10
-rw-r--r--src/commandhandler.cpp2
-rw-r--r--src/gui/killstats.cpp10
-rw-r--r--src/gui/serverdialog.cpp2
-rw-r--r--src/gui/statuswindow.cpp2
-rw-r--r--src/rotationalparticle.cpp4
6 files changed, 13 insertions, 17 deletions
diff --git a/build/bmakesnapshot b/build/bmakesnapshot
index d77f2eb0c..89f465251 100755
--- a/build/bmakesnapshot
+++ b/build/bmakesnapshot
@@ -2,8 +2,6 @@
cd ..
-#need fix: -Wzero-as-null-pointer-constant
-
dir=`pwd`
export PATH=/usr/lib/gcc-snapshot/bin:$PATH
@@ -23,15 +21,13 @@ export CXXFLAGS="-Wvariadic-macros -Wvla -Wredundant-decls \
-Wcast-align -Wpointer-arith -Wundef \
-Wmissing-include-dirs -Winit-self -pedantic -Wall -ggdb3 -O2 -pipe \
-Wpacked -Wextra -Wstrict-overflow=1 -Wunknown-pragmas -Wwrite-strings \
--Wstack-protector -Wshadow -Wunused -Wunused-macros -Wsynth \
+-Wstack-protector -Wshadow -Wunused-macros -Wsynth \
-Wbuiltin-macro-redefined -Wctor-dtor-privacy -Wdeprecated -Wextra \
-Wendif-labels -Wformat=1 -Wimport -Wnon-virtual-dtor -Wpsabi \
-Wsign-promo -Wwrite-strings -D_FORTIFY_SOURCE=2 -Wc++11-compat -std=c++0x \
-Wdelete-non-virtual-dtor -Wmaybe-uninitialized -Wunused-local-typedefs \
--Wvector-operation-performance -Wfree-nonheap-object \
--Winvalid-memory-model -Wmaybe-uninitialized \
--Wnarrowing -Wunused-local-typedefs -Wvector-operation-performance \
--Wzero-as-null-pointer-constant"
+-Wvector-operation-performance -Wfree-nonheap-object -Winvalid-memory-model \
+-Wnarrowing -Wzero-as-null-pointer-constant"
autoreconf -i
./configure --prefix=$dir/run \
diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp
index 0f8df546c..0f1e60a25 100644
--- a/src/commandhandler.cpp
+++ b/src/commandhandler.cpp
@@ -1112,7 +1112,7 @@ void CommandHandler::handleDumpGraphics(const std::string &args A_UNUSED,
str += ",0";
#endif
- str += strprintf(",%f,", Client::getGuiAlpha());
+ str += strprintf(",%f,", static_cast<double>(Client::getGuiAlpha()));
str += config.getBoolValue("adjustPerfomance") ? "1" : "0";
str += config.getBoolValue("alphaCache") ? "1" : "0";
str += config.getBoolValue("enableMapReduce") ? "1" : "0";
diff --git a/src/gui/killstats.cpp b/src/gui/killstats.cpp
index fa6241ef6..972c660ec 100644
--- a/src/gui/killstats.cpp
+++ b/src/gui/killstats.cpp
@@ -70,8 +70,8 @@ KillStats::KillStats():
xpNextLevel = 1;
mLine1 = new Label(strprintf(_("Level: %d at %f%%"),
- player_node->getLevel(), static_cast<float>(xp)
- / static_cast<float>(xpNextLevel) * 100.0f));
+ player_node->getLevel(), static_cast<double>(xp)
+ / static_cast<double>(xpNextLevel) * 100.0));
mLine2 = new Label(strprintf(_("Exp: %d/%d Left: %d"),
xp, xpNextLevel, xpNextLevel - xp));
@@ -206,9 +206,9 @@ void KillStats::gainXp(int xp)
timeDiff = 1;
mLine1->setCaption(strprintf(_("Level: %d at %f%%"),
- player_node->getLevel(), static_cast<float>(
- PlayerInfo::getAttribute(EXP)) / static_cast<float>(
- xpNextLevel) * 100.0f));
+ player_node->getLevel(), static_cast<double>(
+ PlayerInfo::getAttribute(EXP)) / static_cast<double>(
+ xpNextLevel) * 100.0));
mLine2->setCaption(strprintf(_("Exp: %d/%d Left: %d"),
PlayerInfo::getAttribute(EXP), xpNextLevel,
diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp
index 0cfa2d40b..019ea9f1c 100644
--- a/src/gui/serverdialog.cpp
+++ b/src/gui/serverdialog.cpp
@@ -558,7 +558,7 @@ void ServerDialog::logic()
else if (mDownloadStatus == DOWNLOADING_IN_PROGRESS)
{
mDescription->setCaption(strprintf(_("Downloading server list..."
- "%2.2f%%"), mDownloadProgress * 100));
+ "%2.2f%%"), static_cast<double>(mDownloadProgress * 100)));
}
else if (mDownloadStatus == DOWNLOADING_IDLE)
{
diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp
index 20a017a41..410ee08e2 100644
--- a/src/gui/statuswindow.cpp
+++ b/src/gui/statuswindow.cpp
@@ -522,7 +522,7 @@ void StatusWindow::updateProgressBar(ProgressBar *bar, int value, int max,
/ static_cast<float>(max);
if (percent)
- bar->setText(strprintf("%2.5f", 100 * progress) + "%");
+ bar->setText(strprintf("%2.5f%%", static_cast<double>(100 * progress)));
else
bar->setText(toString(value) + "/" + toString(max));
diff --git a/src/rotationalparticle.cpp b/src/rotationalparticle.cpp
index 89b978f4d..f92b0f3eb 100644
--- a/src/rotationalparticle.cpp
+++ b/src/rotationalparticle.cpp
@@ -61,12 +61,12 @@ bool RotationalParticle::update()
float rad = static_cast<float>(atan2(mVelocity.x, mVelocity.y));
if (rad < 0)
- rad = static_cast<float>(PI + (PI + rad));
+ rad = static_cast<float>(PI) + static_cast<float>(PI) + rad;
float range = static_cast<float>(PI / size);
// Determines which frame the particle should play
- if (rad < range || rad > ((PI*2) - range))
+ if (rad < range || rad > ((static_cast<float>(PI)*2) - range))
{
mAnimation->setFrame(0);
}