Fixed some warnings

Removed unused variables and fixed signed/unsigned comparation warnings
dev-mp
krzys-h 2014-09-27 16:49:00 +02:00
parent d3eaf2e1ce
commit c29ef4ec41
3 changed files with 8 additions and 14 deletions

View File

@ -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());
}

View File

@ -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);

View File

@ -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;