summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrzys-h <krzys_h@interia.pl>2014-09-27 16:49:00 +0200
committerkrzys-h <krzys_h@interia.pl>2014-09-27 16:49:00 +0200
commitc29ef4ec41cc062c4dbc14af8736c5e1c7c25f02 (patch)
tree97384eed4eab007876332a51389ad20708c62d1c
parentd3eaf2e1ce9e1275bc0c68be890a939fca666909 (diff)
downloadcolobot-c29ef4ec41cc062c4dbc14af8736c5e1c7c25f02.tar.gz
colobot-c29ef4ec41cc062c4dbc14af8736c5e1c7c25f02.tar.bz2
colobot-c29ef4ec41cc062c4dbc14af8736c5e1c7c25f02.zip
Fixed some warnings
Removed unused variables and fixed signed/unsigned comparation warnings
-rw-r--r--src/object/robotmain.cpp14
-rw-r--r--src/ui/maindialog.cpp7
-rw-r--r--src/ui/studio.cpp1
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;