Clean up : remove unused var, fix warning about printf, use int directly in for statement

This commit is contained in:
Joris 2012-05-21 11:23:59 +02:00
parent 8b3e5c8d45
commit f0830e9982
3 changed files with 6 additions and 9 deletions

View file

@ -698,7 +698,6 @@ void AiForce::Update()
Assert(Map.Info.IsPointOnMap(GoalPos));
std::vector<CUnit *> attackUnits;
CUnit *leader = NULL;
int distance = 0;
Vec2i pos = GoalPos;
if (isTransporterAttack) {

View file

@ -1060,19 +1060,19 @@ static int CclAiDump(lua_State *l)
// Requests
//
size_t n = AiPlayer->UnitTypeRequests.size();
printf("UnitTypeRequests(%lu):\n", n);
printf("UnitTypeRequests(%u):\n", static_cast<unsigned int>(n));
for (size_t i = 0; i < n; ++i) {
printf("%s ", AiPlayer->UnitTypeRequests[i].Type->Ident.c_str());
}
printf("\n");
n = AiPlayer->UpgradeToRequests.size();
printf("UpgradeToRequests(%lu):\n", n);
printf("UpgradeToRequests(%u):\n", static_cast<unsigned int>(n));
for (size_t i = 0; i < n; ++i) {
printf("%s ", AiPlayer->UpgradeToRequests[i]->Ident.c_str());
}
printf("\n");
n = AiPlayer->ResearchRequests.size();
printf("ResearchRequests(%lu):\n", n);
printf("ResearchRequests(%u):\n", static_cast<unsigned int>(n));
for (size_t i = 0; i < n; ++i) {
printf("%s ", AiPlayer->ResearchRequests[i]->Ident.c_str());
}
@ -1088,7 +1088,7 @@ static int CclAiDump(lua_State *l)
// PrintForce
for (size_t i = 0; i < AiPlayer->Force.Size(); ++i) {
printf("Force(%lu%s%s):\n", i,
printf("Force(%u%s%s):\n", static_cast<unsigned int>(i),
AiPlayer->Force[i].Completed ? ",complete" : ",recruit",
AiPlayer->Force[i].Attacking ? ",attack" : "");
for (size_t j = 0; j < AiPlayer->Force[i].UnitTypes.size(); ++j) {

View file

@ -560,8 +560,6 @@ static void GameTypeManTeamVsMachine()
*/
void CreateGame(const std::string &filename, CMap *map)
{
int i;
if (SaveGameLoading) {
SaveGameLoading = false;
// Load game, already created game with Init/LoadModules
@ -580,7 +578,7 @@ void CreateGame(const std::string &filename, CMap *map)
}
}
for (i = 0; i < PlayerMax; ++i) {
for (int i = 0; i < PlayerMax; ++i) {
int playertype = (PlayerTypes)Map.Info.PlayerType[i];
// Network games only:
if (GameSettings.Presets[i].Type != SettingsPresetMapDefault) {
@ -762,7 +760,7 @@ void CreateGame(const std::string &filename, CMap *map)
// FIXME: The palette is loaded after the units are created.
// FIXME: This loops fixes the colors of the units.
//
for (i = 0; i < NumUnits; ++i) {
for (int i = 0; i < NumUnits; ++i) {
// I don't really think that there can be any rescued
// units at this point.
if (Units[i]->RescuedFrom) {