From 93f0d982c9e86d23c9d51b1825060f5ff5bdf793 Mon Sep 17 00:00:00 2001 From: Martin Gerhardy <tlh2000@users.sourceforge.net> Date: Fri, 12 Nov 2010 08:43:12 +0100 Subject: [PATCH] * fixed compilation due to broken sed statement --- src/action/action_resource.cpp | 2 +- src/ai/ai_building.cpp | 8 ++++---- src/ai/ai_plan.cpp | 4 ++-- src/stratagus/script.cpp | 2 +- src/stratagus/script_player.cpp | 2 +- src/stratagus/stratagus.cpp | 2 +- src/unit/script_unittype.cpp | 2 +- src/unit/unit.cpp | 12 ++++++------ src/video/sdl.cpp | 2 +- src/video/sprite.cpp | 9 ++++----- 10 files changed, 22 insertions(+), 23 deletions(-) diff --git a/src/action/action_resource.cpp b/src/action/action_resource.cpp index a3726f269..3e584d086 100644 --- a/src/action/action_resource.cpp +++ b/src/action/action_resource.cpp @@ -929,7 +929,7 @@ void HandleActionResource(CUnit &unit) if (unit.SubAction == SUB_STOP_GATHERING) { if (StopGathering(unit)) { unit.SubAction = SUB_MOVE_TO_DEPOT; - unit.Data.Move.Cycles = 0 //moving counter + unit.Data.Move.Cycles = 0; //moving counter } else return; } diff --git a/src/ai/ai_building.cpp b/src/ai/ai_building.cpp index f4675dfdd..66d7606ab 100644 --- a/src/ai/ai_building.cpp +++ b/src/ai/ai_building.cpp @@ -215,7 +215,7 @@ static int AiFindBuildingPlace2(const CUnit &worker, const CUnitType *type, // // Pop a point from stack, push all neighbours which could be entered. // - for () { + for (;;) { while (rp != ep) { rpos = points[rp]; for (i = 0; i < 8; ++i) { // mark all neighbors @@ -338,7 +338,7 @@ static int AiFindHallPlace(const CUnit &worker, // // Pop a point from stack, push all neighbors which could be entered. // - for () { + for (;;) { while (rp != ep) { rpos = points[rp]; for (i = 0; i < 8; ++i) { // mark all neighbors @@ -483,7 +483,7 @@ static int AiFindLumberMillPlace(const CUnit &worker, const CUnitType *type, // // Pop a point from stack, push all neightbors which could be entered. // - for () { + for (;;) { while (rp != ep) { rpos = points[rp]; for (i = 0; i < 8; ++i) { // mark all neighbors @@ -578,7 +578,7 @@ static int AiFindMiningPlace(const CUnit &worker, // // Pop a point from stack, push all neighbors which could be entered. // - for () { + for (;;) { while (rp != ep) { rpos = points[rp]; for (i = 0; i < 8; ++i) { // mark all neighbors diff --git a/src/ai/ai_plan.cpp b/src/ai/ai_plan.cpp index 9176d90da..fc826a9cf 100644 --- a/src/ai/ai_plan.cpp +++ b/src/ai/ai_plan.cpp @@ -162,7 +162,7 @@ static void AiMarkWaterTransporter(const CUnit &unit, unsigned char *matrix) // // Pop a point from stack, push all neightbors which could be entered. // - for () { + for (;;) { while (rp != ep) { rx = points[rp].X; ry = points[rp].Y; @@ -260,7 +260,7 @@ static bool AiFindTarget(const CUnit &unit, // // Pop a point from stack, push all neightbors which could be entered. // - for () { + for (;;) { while (rp != ep) { rpos = points[rp].pos; state = points[rp].State; diff --git a/src/stratagus/script.cpp b/src/stratagus/script.cpp index 796f8226a..581b7eb6c 100644 --- a/src/stratagus/script.cpp +++ b/src/stratagus/script.cpp @@ -262,7 +262,7 @@ static void LuaLoadBuffer(const std::string &file, std::string &buffer) ExitFatal(-1); } location = 0; - for () { + for (;;) { read = fp.read(&buf[location], size - location); if (read != size - location) { location += read; diff --git a/src/stratagus/script_player.cpp b/src/stratagus/script_player.cpp index 48a403023..ce7a15ba5 100644 --- a/src/stratagus/script_player.cpp +++ b/src/stratagus/script_player.cpp @@ -761,7 +761,7 @@ static int CclGetPlayerData(lua_State *l) } else if (!strcmp(data, "Resources")) { LuaCheckArgs(l, 3); - const std::string res = LuaToString(l, 3) + const std::string res = LuaToString(l, 3); unsigned int i; for (i = 0; i < MaxCosts; ++i) { diff --git a/src/stratagus/stratagus.cpp b/src/stratagus/stratagus.cpp index 7a44bea3e..f3dfe8d3a 100644 --- a/src/stratagus/stratagus.cpp +++ b/src/stratagus/stratagus.cpp @@ -847,7 +847,7 @@ int main(int argc, char **argv) // // Parse commandline // - for () { + for (;;) { #ifdef USE_MAEMO switch (getopt(argc, argv, "c:d:ef:hln:I:P:s:t:v:wD:N:E:S:U:OL:o?")) { #else diff --git a/src/unit/script_unittype.cpp b/src/unit/script_unittype.cpp index dcd28820f..0976b94ff 100644 --- a/src/unit/script_unittype.cpp +++ b/src/unit/script_unittype.cpp @@ -1762,7 +1762,7 @@ static int CclDefineDecorations(lua_State *l) } else if (!strcmp(key, "Width")) { decovarbar->Width = LuaToNumber(l, -1); } else if (!strcmp(key, "Orientation")) { - key = LuaToString(l, -1) + key = LuaToString(l, -1); if (!strcmp(key, "horizontal")) { decovarbar->IsVertical = 0; } else if (!strcmp(key, "vertical")) { diff --git a/src/unit/unit.cpp b/src/unit/unit.cpp index 03c3365f3..5057e029d 100644 --- a/src/unit/unit.cpp +++ b/src/unit/unit.cpp @@ -1863,7 +1863,7 @@ void DropOutOnSide(CUnit &unit, int heading, int addx, int addy) goto startw; // FIXME: don't search outside of the map - for () { + for (;;) { startw: for (i = addy; i--; ++pos.y) { if (UnitCanBeAt(unit, pos.x, pos.y)) { @@ -1922,7 +1922,7 @@ void DropOutNearest(CUnit &unit, const Vec2i &goalPos, int addx, int addy) // FIXME: if we reach the map borders we can go fast up, left, ... --pos.x; - for () { + for (;;) { for (int i = addy; i--; ++pos.y) { // go down if (UnitCanBeAt(unit, pos.x, pos.y)) { const int n = MapDistance(goalPos.x, goalPos.y, pos.x, pos.y); @@ -2069,7 +2069,7 @@ int FindTerrainType(int movemask, int resmask, int rvresult, int range, // // Pop a point from stack, push all neighbors which could be entered. // - for () { + for (;;) { while (rp != ep) { rpos = points[rp]; for (i = 0; i < 8; ++i) { // mark all neighbors @@ -2317,7 +2317,7 @@ CUnit *UnitFindResource(const CUnit &unit, int x, int y, int range, int resource // // Pop a point from stack, push all neighbors which could be entered. // - for () { + for (;;) { while (rp != ep) { rpos = points[rp]; for (i = 0; i < 9; ++i) { // mark all neighbors @@ -2526,7 +2526,7 @@ CUnit *UnitFindMiningArea(const CUnit &unit, int x, int y, int range, int resou // // Pop a point from stack, push all neighbors which could be entered. // - for () { + for (;;) { while (rp != ep) { rpos = points[rp]; for (i = 0; i < 9; ++i) { // mark all neighbors @@ -3285,7 +3285,7 @@ int ViewPointDistance(int x, int y) */ int ViewPointDistanceToUnit(const CUnit &dest) { - const CViewport &vp = *UI.SelectedViewport + const CViewport &vp = *UI.SelectedViewport; return dest.MapDistanceTo(vp.MapX + vp.MapWidth / 2, vp.MapY + vp.MapHeight / 2); } diff --git a/src/video/sdl.cpp b/src/video/sdl.cpp index 18b0626b9..3be17559b 100644 --- a/src/video/sdl.cpp +++ b/src/video/sdl.cpp @@ -873,7 +873,7 @@ void WaitEventsOneFrame() interrupts = 0; - for () { + for (;;) { // // Time of frame over? This makes the CPU happy. :( // diff --git a/src/video/sprite.cpp b/src/video/sprite.cpp index 7cb8053b4..0ebe002ba 100644 --- a/src/video/sprite.cpp +++ b/src/video/sprite.cpp @@ -99,8 +99,8 @@ void DrawTexture(const CGraphic *g, GLuint *textures, Assert(gx_end <= g->GraphicWidth); Assert(gy_end <= g->GraphicHeight); - for (int tex_gy_beg = gy_beg / GLMaxTextureSize * GLMaxTextureSize - tex_gy_beg += GLMaxTextureSize) { + for (int tex_gy_beg = gy_beg / GLMaxTextureSize * GLMaxTextureSize;; + tex_gy_beg += GLMaxTextureSize) { int tex_gy_end = tex_gy_beg + GLMaxTextureSize; int clip_gy_beg = std::max<int>(gy_beg, tex_gy_beg); int clip_gy_end = std::min<int>(gy_end, tex_gy_end); @@ -133,9 +133,8 @@ void DrawTexture(const CGraphic *g, GLuint *textures, Assert(clip_ty_beg < clip_ty_end); Assert(clip_ty_end <= 1.0f); - for (int tex_gx_beg = gx_beg / GLMaxTextureSize - * GLMaxTextureSize - tex_gx_beg += GLMaxTextureSize) { + for (int tex_gx_beg = gx_beg / GLMaxTextureSize * GLMaxTextureSize;; + tex_gx_beg += GLMaxTextureSize) { int tex_gx_end = tex_gx_beg + GLMaxTextureSize; int clip_gx_beg = std::max<int>(gx_beg, tex_gx_beg); int clip_gx_end = std::min<int>(gx_end, tex_gx_end);