[colobot] 66/390: Fixed some warnings
Didier Raboud
odyx at moszumanska.debian.org
Fri Jun 12 14:21:29 UTC 2015
This is an automated email from the git hooks/post-receive script.
odyx pushed a commit to branch upstream/latest
in repository colobot.
commit c29ef4ec41cc062c4dbc14af8736c5e1c7c25f02
Author: krzys-h <krzys_h at interia.pl>
Date: Sat Sep 27 16:49:00 2014 +0200
Fixed some warnings
Removed unused variables and fixed signed/unsigned comparation warnings
---
src/object/robotmain.cpp | 14 +++++++-------
src/ui/maindialog.cpp | 7 +------
src/ui/studio.cpp | 1 -
3 files changed, 8 insertions(+), 14 deletions(-)
diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp
index 315ffe1..0fa9b0d 100644
--- a/src/object/robotmain.cpp
+++ b/src/object/robotmain.cpp
@@ -4296,8 +4296,8 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
std::string name = line->GetParam("image")->AsPath(""); //TODO: don't make this relative to textures/
if(name.find(".") == std::string::npos)
name += ".png";
- int dx = line->GetParam("dx")->AsInt(1);
- int dy = line->GetParam("dy")->AsInt(1);
+ unsigned int dx = line->GetParam("dx")->AsInt(1);
+ unsigned int dy = line->GetParam("dy")->AsInt(1);
int tt[100]; //TODO: I have no idea how TerrainInitTextures works, but maybe we shuld remove the limit to 100?
if(dx*dy > 100)
@@ -4308,7 +4308,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
if(table.size() > dx*dy)
throw CLevelParserException("In TerrainInitTextures: table size must be dx*dy");
- for (int i = 0; i < dx*dy; i++)
+ for (unsigned int i = 0; i < dx*dy; i++)
{
if(i >= table.size())
{
@@ -4318,7 +4318,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
}
}
} else {
- for (int i = 0; i < dx*dy; i++)
+ for (unsigned int i = 0; i < dx*dy; i++)
{
tt[i] = 0;
}
@@ -4373,7 +4373,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
if(id_array.size() > 50)
throw CLevelParserException("In TerrainLevel: id array size must be < 50");
- int i = 0;
+ unsigned int i = 0;
while (i < 50)
{
id[i] = id_array[i]->AsInt();
@@ -4528,7 +4528,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
// Sets the parameters of the command line.
if(line->GetParam("cmdline")->IsDefined()) {
const std::vector<CLevelParserParam*>& cmdline = line->GetParam("cmdline")->AsArray();
- for (int i = 0; i < OBJECTMAXCMDLINE && i < cmdline.size(); i++) //TODO: get rid of the limit
+ for (unsigned int i = 0; i < OBJECTMAXCMDLINE && i < cmdline.size(); i++) //TODO: get rid of the limit
{
obj->SetCmdLine(i, cmdline[i]->AsFloat());
}
@@ -4569,7 +4569,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
if (motion != nullptr && line->GetParam("param")->IsDefined())
{
const std::vector<CLevelParserParam*>& p = line->GetParam("param")->AsArray();
- for (int i = 0; i < 10 && i < p.size(); i++)
+ for (unsigned int i = 0; i < 10 && i < p.size(); i++)
{
motion->SetParam(i, p[i]->AsFloat());
}
diff --git a/src/ui/maindialog.cpp b/src/ui/maindialog.cpp
index 3acf1dd..b886691 100644
--- a/src/ui/maindialog.cpp
+++ b/src/ui/maindialog.cpp
@@ -4612,11 +4612,7 @@ void CMainDialog::UpdateSceneResume(int rank)
CEdit* pe;
CCheck* pc;
std::string fileName;
- char op[100];
- char op_i18n[100];
- char line[500];
- char name[500];
- int i, numTry;
+ int numTry;
bool bPassed, bVisible;
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
@@ -5889,7 +5885,6 @@ void CMainDialog::FrameDialog(float rTime)
void CMainDialog::StopDialog()
{
CWindow* pw;
- CButton* pb;
pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW0));
if ( pw != 0 ) pw->SetState(STATE_ENABLE);
diff --git a/src/ui/studio.cpp b/src/ui/studio.cpp
index 91e4ea2..52bb8d6 100644
--- a/src/ui/studio.cpp
+++ b/src/ui/studio.cpp
@@ -850,7 +850,6 @@ bool CStudio::StopEditScript(bool bCancel)
{
CWindow* pw;
CEdit* edit;
- CButton* button;
pw = static_cast< CWindow* >(m_interface->SearchControl(EVENT_WINDOW3));
if ( pw == nullptr ) return false;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git
More information about the Pkg-games-commits
mailing list