From: Côme Chilliet Date: Sun, 20 Nov 2016 15:36:36 +0000 (+0800) Subject: Fixed some warnings X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=e2cad9c4ba05196efe03ab2fed8e51bafda53759;p=lugaru.git Fixed some warnings --- diff --git a/Source/Account.cpp b/Source/Account.cpp index 09bf0d1..a087158 100644 --- a/Source/Account.cpp +++ b/Source/Account.cpp @@ -71,7 +71,7 @@ void Account::destroy(int i) } Account* Account::destroy(Account* a) { - for (int i = 0; i < accounts.size(); i++) { + for (unsigned i = 0; i < accounts.size(); i++) { if (accounts[i] == a) { accounts.erase(accounts.begin() + i); return NULL; @@ -198,7 +198,7 @@ Account* Account::loadFile(string filename) void Account::saveFile(string filename, Account* accountactive) { FILE *tfile; - int j; + unsigned j; tfile = fopen(ConvertFileName(filename.c_str(), "wb"), "wb" ); if (tfile) { @@ -254,7 +254,7 @@ void Account::saveFile(string filename, Account* accountactive) int Account::indice(Account* a) { - for (int i = 0; i < accounts.size(); i++) { + for (unsigned i = 0; i < accounts.size(); i++) { if (accounts[i] == a) return i; } diff --git a/Source/Awards.cpp b/Source/Awards.cpp index 95fd129..160ec45 100644 --- a/Source/Awards.cpp +++ b/Source/Awards.cpp @@ -30,6 +30,18 @@ float startbonustotal; float bonustime; float bonusnum[100]; +const char *bonus_names[bonus_count] = { +#define DECLARE_BONUS(id, name, ...) name, +#include "Bonuses.def" +#undef DECLARE_BONUS +}; + +const char *award_names[award_count] = { +#define DECLARE_AWARD(id, name) name, +#include "Awards.def" +#undef DECLARE_AWARD +}; + static const int bonus_values[bonus_count] = { #define DECLARE_BONUS(id, name, value, ...) value, #include "Bonuses.def" diff --git a/Source/Awards.h b/Source/Awards.h index 8e45a68..03bf4e5 100644 --- a/Source/Awards.h +++ b/Source/Awards.h @@ -29,11 +29,7 @@ enum bonus_types { bonus_count }; -static const char *bonus_names[bonus_count] = { -#define DECLARE_BONUS(id, name, ...) name, -#include "Bonuses.def" -#undef DECLARE_BONUS -}; +extern const char *bonus_names[bonus_count]; extern int bonus; extern float bonusvalue; @@ -51,11 +47,7 @@ enum award_types { award_count }; -static const char *award_names[award_count] = { -#define DECLARE_AWARD(id, name) name, -#include "Awards.def" -#undef DECLARE_AWARD -}; +extern const char *award_names[award_count]; extern int award_awards(int *); diff --git a/Source/Game.cpp b/Source/Game.cpp index f41a92a..2f88d34 100644 --- a/Source/Game.cpp +++ b/Source/Game.cpp @@ -47,6 +47,12 @@ int directing; float dialoguetime; int dialoguegonethrough[20]; +const char *pathtypenames[] = {"keepwalking", "pause"}; +const char *editortypenames[] = { + "active", "sitting", "sitting wall", "sleeping", + "dead1", "dead2", "dead3", "dead4" +}; + namespace Game { Texture terraintexture; diff --git a/Source/Game.h b/Source/Game.h index 98f6f64..6469091 100644 --- a/Source/Game.h +++ b/Source/Game.h @@ -236,15 +236,12 @@ enum maptypes { enum pathtypes {wpkeepwalking, wppause}; -static const char *pathtypenames[] = {"keepwalking", "pause"}; +extern const char *pathtypenames[2]; enum editortypes {typeactive, typesitting, typesittingwall, typesleeping, typedead1, typedead2, typedead3, typedead4 }; -static const char *editortypenames[] = { - "active", "sitting", "sitting wall", "sleeping", - "dead1", "dead2", "dead3", "dead4" -}; +extern const char *editortypenames[8]; #endif diff --git a/Source/GameDraw.cpp b/Source/GameDraw.cpp index 37c4f8d..7d9eb8b 100644 --- a/Source/GameDraw.cpp +++ b/Source/GameDraw.cpp @@ -137,8 +137,7 @@ int Game::DrawGLScene(StereoSide side) { static float texcoordwidth, texcoordheight; static float texviewwidth, texviewheight; - static int i, j, k, l; - //~ static GLubyte color; + static int i, j, l; static XYZ checkpoint; static float tempmult; float tutorialopac; @@ -333,7 +332,7 @@ int Game::DrawGLScene(StereoSide side) static XYZ point; static float size, opacity, rotation; rotation = 0; - for (k = 0; k < Person::players.size(); k++) { + for (unsigned k = 0; k < Person::players.size(); k++) { if (!Person::players[k]->skeleton.free && Person::players[k]->playerdetail && Person::players[k]->howactive < typesleeping) if (frustum.SphereInFrustum(Person::players[k]->coords.x, Person::players[k]->coords.y + Person::players[k]->scale * 3, Person::players[k]->coords.z, Person::players[k]->scale * 7) && Person::players[k]->occluded < 25) for (i = 0; i < Person::players[k]->skeleton.num_joints; i++) { @@ -451,7 +450,7 @@ int Game::DrawGLScene(StereoSide side) glEnable(GL_CULL_FACE); glCullFace(GL_FRONT); glDepthMask(1); - for (k = 0; k < Person::players.size(); k++) { + for (unsigned k = 0; k < Person::players.size(); k++) { if (k == 0 || tutoriallevel != 1) { glEnable(GL_BLEND); glEnable(GL_LIGHTING); @@ -515,7 +514,7 @@ int Game::DrawGLScene(StereoSide side) glEnable(GL_CULL_FACE); glCullFace(GL_FRONT); glDepthMask(1); - for (k = 0; k < Person::players.size(); k++) { + for (unsigned k = 0; k < Person::players.size(); k++) { if (!(k == 0 || tutoriallevel != 1)) { glEnable(GL_BLEND); glEnable(GL_LIGHTING); @@ -567,7 +566,7 @@ int Game::DrawGLScene(StereoSide side) glDisable(GL_COLOR_MATERIAL); glColor4f(1, 1, 0, 1); - for (k = 0; k < Person::players.size(); k++) { + for (unsigned k = 0; k < Person::players.size(); k++) { if (Person::players[k]->numwaypoints > 1) { glBegin(GL_LINE_LOOP); for (i = 0; i < Person::players[k]->numwaypoints; i++) { @@ -580,7 +579,7 @@ int Game::DrawGLScene(StereoSide side) if (numpathpoints > 1) { glColor4f(0, 1, 0, 1); - for (k = 0; k < numpathpoints; k++) { + for (unsigned k = 0; int(k) < numpathpoints; k++) { if (numpathpointconnect[k]) { for (i = 0; i < numpathpointconnect[k]; i++) { glBegin(GL_LINE_LOOP); @@ -603,9 +602,6 @@ int Game::DrawGLScene(StereoSide side) glEnable(GL_TEXTURE_2D); glColor4f(.5, .5, .5, 1); if (!console) { - sprintf (string, " ", (int)(fps)); - text->glPrint(10, 30, string, 0, .8, screenwidth, screenheight); - if (!tutoriallevel) if (bonus > 0 && bonustime < 1 && !winfreeze && indialogue == -1/*bonustime<4*/) { const char *bonus_name; @@ -1301,9 +1297,9 @@ int Game::DrawGLScene(StereoSide side) } text->glPrint(130, 120, string, 0, .8, 1024, 768); - sprintf (string, "Numplayers: %d", Person::players.size()); + sprintf (string, "Numplayers: %lu", Person::players.size()); text->glPrint(10, 155, string, 0, .8, 1024, 768); - sprintf (string, "Player %d: numwaypoints: %d", Person::players.size()-1, Person::players.back()->numwaypoints); + sprintf (string, "Player %d: numwaypoints: %d", (int(Person::players.size()) - 1), Person::players.back()->numwaypoints); text->glPrint(10, 140, string, 0, .8, 1024, 768); } sprintf (string, "Difficulty: %d", difficulty); diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index cf93da3..8b7b267 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -582,7 +582,7 @@ static void ch_save(const char *args) if (Person::players.size() > maxplayers) { cout << "Warning: this level contains more players than allowed" << endl; } - for (int j = 1; j < Person::players.size(); j++) { + for (unsigned j = 1; j < Person::players.size(); j++) { fpackf(tfile, "Bi Bi Bf Bf Bf Bi Bi Bf Bb Bf", Person::players[j]->whichskin, Person::players[j]->creature, Person::players[j]->coords.x, Person::players[j]->coords.y, Person::players[j]->coords.z, Person::players[j]->num_weapons, Person::players[j]->howactive, Person::players[j]->scale, Person::players[j]->immobile, Person::players[j]->yaw); @@ -698,7 +698,7 @@ static int findClosestPlayer() int closest = -1; float closestdist = std::numeric_limits::max(); - for (int i = 1; i < Person::players.size(); i++) { + for (unsigned i = 1; i < Person::players.size(); i++) { float distance = distsq(&Person::players[i]->coords, &Person::players[0]->coords); if (distance < closestdist) { closestdist = distance; @@ -969,7 +969,7 @@ static void ch_black(const char *args) static void ch_sizemin(const char *args) { - for (int i = 1; i < Person::players.size(); i++) + for (unsigned i = 1; i < Person::players.size(); i++) if (Person::players[i]->scale < 0.8 * 0.2) Person::players[i]->scale = 0.8 * 0.2; } @@ -1076,7 +1076,7 @@ static void ch_dialogue(const char *args) } for (int i = 0; i < numdialogueboxes[numdialogues]; i++) { - for (int j = 0; j < Person::players.size(); j++) { + for (unsigned j = 0; j < Person::players.size(); j++) { participantfacing[numdialogues][i][j] = Person::players[j]->facing; } } @@ -1159,7 +1159,7 @@ static void ch_immobile(const char *args) static void ch_allimmobile(const char *args) { - for (int i = 1; i < Person::players.size(); i++) + for (unsigned i = 1; i < Person::players.size(); i++) Person::players[i]->immobile = 1; } @@ -2148,7 +2148,7 @@ void Loadlevel(const char *name) fclose(tfile); - for (int i = 0; i < Person::players.size(); i++) { + for (unsigned i = 0; i < Person::players.size(); i++) { if (visibleloading) LoadingScreen(); Person::players[i]->burnt = 0; @@ -3056,7 +3056,7 @@ void doDebugKeys() int closest = -1; float closestdist = std::numeric_limits::max(); - for (int i = 1; i < Person::players.size(); i++) { + for (unsigned i = 1; i < Person::players.size(); i++) { float distance = distsq(&Person::players[i]->coords, &Person::players[0]->coords); if (!Person::players[i]->headless) if (distance < closestdist) { @@ -3181,8 +3181,8 @@ void doDebugKeys() } XYZ temppos; - for (int j = 0; j < Person::players.size(); j++) { - if (j != closest) { + for (unsigned j = 0; j < Person::players.size(); j++) { + if (int(j) != closest) { if (distsq(&Person::players[j]->coords, &Person::players[closest]->coords) < 25) { Person::players[j]->DoDamage((25 - distsq(&Person::players[j]->coords, &Person::players[closest]->coords)) * 60); if (Person::players[j]->skeleton.free == 2) @@ -3578,8 +3578,8 @@ void doDebugKeys() void doJumpReversals() { - for (int k = 0; k < Person::players.size(); k++) - for (int i = k; i < Person::players.size(); i++) { + for (unsigned k = 0; k < Person::players.size(); k++) + for (unsigned i = k; i < Person::players.size(); i++) { if (i == k) continue; if ( Person::players[k]->skeleton.free == 0 && @@ -3588,8 +3588,8 @@ void doJumpReversals() Person::players[k]->animTarget == jumpupanim) && (Person::players[i]->aitype == playercontrolled || Person::players[k]->aitype == playercontrolled) && - (Person::players[i]->aitype == attacktypecutoff && Person::players[i]->stunned <= 0 || - Person::players[k]->aitype == attacktypecutoff && Person::players[k]->stunned <= 0)) { + ((Person::players[i]->aitype == attacktypecutoff && Person::players[i]->stunned <= 0) || + (Person::players[k]->aitype == attacktypecutoff && Person::players[k]->stunned <= 0))) { if ( distsq(&Person::players[i]->coords, &Person::players[k]->coords) < 10 * sq((Person::players[i]->scale + Person::players[k]->scale) * 2.5) && distsqflat(&Person::players[i]->coords, &Person::players[k]->coords) < 2 * sq((Person::players[i]->scale + Person::players[k]->scale) * 2.5)) { //TODO: refactor two huge similar ifs @@ -3598,7 +3598,7 @@ void doJumpReversals() Person::players[k]->animTarget != getupfromfrontanim && animation[Person::players[k]->animTarget].height == middleheight && normaldotproduct(Person::players[i]->velocity, Person::players[k]->coords - Person::players[i]->coords) < 0 && - (Person::players[k]->aitype == playercontrolled && Person::players[k]->attackkeydown || + ((Person::players[k]->aitype == playercontrolled && Person::players[k]->attackkeydown) || Person::players[k]->aitype != playercontrolled)) { Person::players[i]->victim = Person::players[k]; Person::players[i]->velocity = 0; @@ -3679,7 +3679,7 @@ void doJumpReversals() void doAerialAcrobatics() { static XYZ facing, flatfacing; - for (int k = 0; k < Person::players.size(); k++) { + for (unsigned k = 0; k < Person::players.size(); k++) { Person::players[k]->turnspeed = 500; if ((Person::players[k]->isRun() && @@ -4080,7 +4080,7 @@ void doAttacks() if (Input::isKeyDown(attackkey) && !oldattackkey && !Person::players[0]->backkeydown) { - for (int k = 0; k < Person::players.size(); k++) { + for (unsigned k = 0; k < Person::players.size(); k++) { if ((Person::players[k]->animTarget == swordslashanim || Person::players[k]->animTarget == staffhitanim || Person::players[k]->animTarget == staffspinhitanim) && @@ -4093,7 +4093,7 @@ void doAttacks() if (!hostile || indialogue != -1) Person::players[0]->attackkeydown = 0; - for (int k = 0; k < Person::players.size(); k++) { + for (unsigned k = 0; k < Person::players.size(); k++) { if (indialogue != -1) Person::players[k]->attackkeydown = 0; if (Person::players[k]->animTarget != rabbitrunninganim && Person::players[k]->animTarget != wolfrunninganim) { @@ -4111,7 +4111,7 @@ void doAttacks() if (Person::players[k]->jumppower <= 1) { Person::players[k]->jumppower -= 2; } else { - for (int i = 0; i < Person::players.size(); i++) { + for (unsigned i = 0; i < Person::players.size(); i++) { if (i == k) continue; if (Person::players[i]->animTarget == swordslashanim || @@ -4150,7 +4150,7 @@ void doAttacks() //normal attacks (?) Person::players[k]->hasvictim = 0; if (Person::players.size() > 1) - for (int i = 0; i < Person::players.size(); i++) { + for (unsigned i = 0; i < Person::players.size(); i++) { if (i == k || !(k == 0 || i == 0)) continue; if (!Person::players[k]->hasvictim) @@ -4421,7 +4421,7 @@ void doAttacks() } const bool hasstaff = attackweapon == staff; if (k == 0 && Person::players.size() > 1) - for (int i = 0; i < Person::players.size(); i++) { + for (unsigned i = 0; i < Person::players.size(); i++) { if (i == k) continue; if ((playerrealattackkeydown || Person::players[i]->dead || !hasstaff) && @@ -4546,7 +4546,7 @@ void doAttacks() } if (!Person::players[k]->hasvictim) { //find victim - for (int i = 0; i < Person::players.size(); i++) { + for (unsigned i = 0; i < Person::players.size(); i++) { if (i == k || !(i == 0 || k == 0)) continue; if (!Person::players[i]->skeleton.free) { @@ -4609,8 +4609,8 @@ void doPlayerCollisions() static XYZ rotatetarget; static float collisionradius; if (Person::players.size() > 1) - for (int k = 0; k < Person::players.size(); k++) - for (int i = k + 1; i < Person::players.size(); i++) { + for (unsigned k = 0; k < Person::players.size(); k++) + for (unsigned i = k + 1; i < Person::players.size(); i++) { //neither player is part of a reversal if ((animation[Person::players[i]->animTarget].attack != reversed && animation[Person::players[i]->animTarget].attack != reversal && @@ -4968,7 +4968,7 @@ void doAI(int i) if (Person::players[i]->losupdatedelay < 0 && !editorenabled && Person::players[i]->occluded < 2) { Person::players[i]->losupdatedelay = .2; - for (int j = 0; j < Person::players.size(); j++) + for (unsigned j = 0; j < Person::players.size(); j++) if (j == 0 || Person::players[j]->skeleton.free || Person::players[j]->aitype != passivetype) if (abs(Random() % 2) || animation[Person::players[j]->animTarget].height != lowheight || j != 0) if (distsq(&Person::players[i]->coords, &Person::players[j]->coords) < 400) @@ -5089,7 +5089,7 @@ void doAI(int i) //wolf smell if (Person::players[i]->creature == wolftype) { XYZ windsmell; - for (int j = 0; j < Person::players.size(); j++) { + for (unsigned j = 0; j < Person::players.size(); j++) { if (j == 0 || (Person::players[j]->dead && Person::players[j]->bloodloss > 0)) { float smelldistance = 50; if (j == 0 && Person::players[j]->num_weapons > 0) { @@ -5112,7 +5112,7 @@ void doAI(int i) if (Person::players[i]->howactive < typesleeping && Person::players[i]->losupdatedelay < 0 && !editorenabled && Person::players[i]->occluded < 2) { Person::players[i]->losupdatedelay = .2; - for (int j = 0; j < Person::players.size(); j++) { + for (unsigned j = 0; j < Person::players.size(); j++) { if (j == 0 || Person::players[j]->skeleton.free || Person::players[j]->aitype != passivetype) { if (abs(Random() % 2) || animation[Person::players[j]->animTarget].height != lowheight || j != 0) if (distsq(&Person::players[i]->coords, &Person::players[j]->coords) < 400) @@ -5302,7 +5302,7 @@ void doAI(int i) if (!Person::players[i]->ally) { int closest = -1; float closestdist = -1; - for (int k = 0; k < Person::players.size(); k++) { + for (unsigned k = 0; k < Person::players.size(); k++) { if (k != i && k != 0 && !Person::players[k]->dead && Person::players[k]->howactive < typedead1 && !Person::players[k]->skeleton.free && @@ -5651,7 +5651,7 @@ void doAI(int i) Person::players[i]->isCrouch() || Person::players[i]->isRun())) { int target = -2; - for (int j = 0; j < Person::players.size(); j++) + for (unsigned j = 0; j < Person::players.size(); j++) if (j != i && !Person::players[j]->skeleton.free && Person::players[j]->hasvictim && (tutoriallevel == 1 && reversaltrain || @@ -6865,7 +6865,7 @@ void Game::Tick() } } - for (int j = 0; j < Person::players.size(); j++) { + for (unsigned j = 0; j < Person::players.size(); j++) { participantfacing[whichdialogue][indialogue][j] = participantfacing[whichdialogue][indialogue - 1][j]; } } @@ -6992,11 +6992,11 @@ void Game::Tick() doJumpReversals(); - for (int k = 0; k < Person::players.size(); k++) + for (unsigned k = 0; k < Person::players.size(); k++) if (k != 0 && Person::players[k]->immobile) Person::players[k]->coords = Person::players[k]->realoldcoords; - for (int k = 0; k < Person::players.size(); k++) { + for (unsigned k = 0; k < Person::players.size(); k++) { if (!isnormal(Person::players[k]->coords.x) || !isnormal(Person::players[k]->coords.y) || !isnormal(Person::players[k]->coords.z)) { if (!isnormal(Person::players[k]->coords.x) || !isnormal(Person::players[k]->coords.y) || !isnormal(Person::players[k]->coords.z)) { Person::players[k]->DoDamage(1000); @@ -7030,7 +7030,7 @@ void Game::Tick() static bool movekey; //? - for (int i = 0; i < Person::players.size(); i++) { + for (unsigned i = 0; i < Person::players.size(); i++) { static float oldtargetyaw; if (!Person::players[i]->skeleton.free) { oldtargetyaw = Person::players[i]->targetyaw; @@ -7118,7 +7118,7 @@ void Game::Tick() } //avoid flaming players - for (int j = 0; j < Person::players.size(); j++) + for (unsigned j = 0; j < Person::players.size(); j++) if (Person::players[j]->onfire) if (distsq(&Person::players[j]->coords, &Person::players[i]->coords) < sq(0.3) * 200) if ( distsq(&Person::players[i]->coords, &Person::players[j]->coords) < @@ -7284,7 +7284,7 @@ void Game::Tick() Person::players[i]->isIdle() || Person::players[i]->animTarget == rollanim || Person::players[i]->animTarget == backhandspringanim) { if (Person::players.size() > 1) - for (int j = 0; j < Person::players.size(); j++) { + for (unsigned j = 0; j < Person::players.size(); j++) { if (Person::players[i]->weaponactive == -1) if (j != i) if (Person::players[j]->num_weapons && @@ -7391,7 +7391,7 @@ void Game::Tick() Person::players[i]->animTarget == sneakanim || Person::players[i]->isFlip()) if (Person::players.size() > 1) - for (int j = 0; j < Person::players.size(); j++) { + for (unsigned j = 0; j < Person::players.size(); j++) { if (i != j) if (tutoriallevel != 1 || tutorialstage == 49) if (hostile) @@ -7455,7 +7455,7 @@ void Game::Tick() } Person::players[i]->weaponactive = -1; - for (int j = 0; j < Person::players.size(); j++) { + for (unsigned j = 0; j < Person::players.size(); j++) { Person::players[j]->wentforweapon = 0; } } @@ -7552,14 +7552,14 @@ void Game::Tick() if (i == 0) { Person::players[i]->superruntoggle = 1; if (Person::players.size() > 1) - for (int j = 0; j < Person::players.size(); j++) + for (unsigned j = 0; j < Person::players.size(); j++) if (j != i && !Person::players[j]->skeleton.free && Person::players[j]->aitype == passivetype) if (distsq(&Person::players[j]->coords, &Person::players[i]->coords) < 16) Person::players[i]->superruntoggle = 0; } if (Person::players.size() > 1) - for (int j = 0; j < Person::players.size(); j++) { + for (unsigned j = 0; j < Person::players.size(); j++) { if (j != i && !Person::players[j]->skeleton.free && Person::players[j]->victim && Person::players[i]->lowreversaldelay <= 0) { if (distsq(&Person::players[j]->coords, &Person::players[j]->victim->coords) < 3 && Person::players[j]->victim == Person::players[i] && @@ -7603,7 +7603,7 @@ void Game::Tick() target = -2; if (Person::players[i]->isCrouch()) { if (Person::players.size() > 1) - for (int j = 0; j < Person::players.size(); j++) { + for (unsigned j = 0; j < Person::players.size(); j++) { if (j != i && !Person::players[j]->skeleton.free && Person::players[j]->victim && @@ -7793,7 +7793,7 @@ void Game::Tick() //Dodge sweep? target = -2; if (Person::players.size() > 1) - for (int j = 0; j < Person::players.size(); j++) { + for (unsigned j = 0; j < Person::players.size(); j++) { if (j != i && !Person::players[j]->skeleton.free && Person::players[j]->victim) { if (distsq(&Person::players[j]->coords, &Person::players[j]->victim->coords) < 3 && (Person::players[j]->victim == Person::players[i]) && @@ -7878,7 +7878,7 @@ void Game::Tick() } //Rotation - for (int k = 0; k < Person::players.size(); k++) { + for (unsigned k = 0; k < Person::players.size(); k++) { if (fabs(Person::players[k]->yaw - Person::players[k]->targetyaw) > 180) { if (Person::players[k]->yaw > Person::players[k]->targetyaw) Person::players[k]->yaw -= 360; @@ -7915,7 +7915,7 @@ void Game::Tick() } //do animations - for (int k = 0; k < Person::players.size(); k++) { + for (unsigned k = 0; k < Person::players.size(); k++) { Person::players[k]->DoAnimations(); Person::players[k]->whichpatchx = Person::players[k]->coords.x / (terrain.size / subdivision * terrain.scale); Person::players[k]->whichpatchz = Person::players[k]->coords.z / (terrain.size / subdivision * terrain.scale); @@ -8099,7 +8099,7 @@ void Game::TickOnceAfter() realthreat = 0; musictype = leveltheme; - for (int i = 0; i < Person::players.size(); i++) { + for (unsigned i = 0; i < Person::players.size(); i++) { if ((Person::players[i]->aitype == attacktypecutoff || Person::players[i]->aitype == getweapontype || Person::players[i]->aitype == gethelptype || diff --git a/Source/OpenGL_Windows.cpp b/Source/OpenGL_Windows.cpp index a5ca6c0..b0dc01d 100644 --- a/Source/OpenGL_Windows.cpp +++ b/Source/OpenGL_Windows.cpp @@ -272,8 +272,6 @@ static Point gMidPoint; Boolean SetUp () { - char string[10]; - LOGFUNC; osx = 0; @@ -643,7 +641,6 @@ char *calcBaseDir(const char *argv0) char *retval; char *envr; - const char *ptr = strrchr((char *)argv0, '/'); if (strchr(argv0, '/')) { retval = strdup(argv0); if (retval) @@ -868,7 +865,6 @@ static bool load_png(const char *file_name, TGAImageRec &tex) png_infop info_ptr = NULL; png_uint_32 width, height; int bit_depth, color_type, interlace_type; - png_byte **rows = NULL; bool retval = false; png_byte **row_pointers = NULL; FILE *fp = fopen(file_name, "rb"); @@ -914,7 +910,7 @@ static bool load_png(const char *file_name, TGAImageRec &tex) png_byte *dst = tex.data; for (int i = height - 1; i >= 0; i--) { png_byte *src = row_pointers[i]; - for (int j = 0; j < width; j++) { + for (unsigned j = 0; j < width; j++) { dst[0] = src[0]; dst[1] = src[1]; dst[2] = src[2];