diff --git a/McZapkie/Mover.cpp b/McZapkie/Mover.cpp index 38b057c1..494c32f6 100644 --- a/McZapkie/Mover.cpp +++ b/McZapkie/Mover.cpp @@ -1476,7 +1476,6 @@ double TMoverParameters::ComputeMovement(double dt, double dt1, const TTrackShap double TMoverParameters::FastComputeMovement(double dt, const TTrackShape & /*Shape*/, TTrackParam & /*Track*/, TLocation const &NewLoc, TRotation const &NewRot) { - int b; // T_MoverParameters::FastComputeMovement(dt, Shape, Track, NewLoc, NewRot); Loc = NewLoc; @@ -1517,7 +1516,7 @@ double TMoverParameters::FastComputeMovement(double dt, const TTrackShape & /*Sh dL = (3.0 * V - Vprev) * dt / 2.0; // metoda Adamsa-Bashfortha // ale jesli jest kolizja (zas. zach. pedu) to... - for (b = 0; b < 2; b++) + for (int b = 0; b < 2; b++) if (Couplers[b].CheckCollision) CollisionDetect(b, dt); // zmienia niejawnie AccS, V !!! } // liczone dL, predkosc i przyspieszenie @@ -11701,7 +11700,6 @@ TEngineType TMoverParameters::LoadFIZ_EngineDecode(std::string const &Engine) co bool TMoverParameters::CheckLocomotiveParameters(bool ReadyFlag, int /*Dir*/) { WriteLog("check locomotive parameters..."); - int b; bool OK = true; AutoRelayFlag = AutoRelayType == 1; @@ -12052,7 +12050,7 @@ bool TMoverParameters::CheckLocomotiveParameters(bool ReadyFlag, int /*Dir*/) // yB: jesli pojazdy nie maja zadeklarowanych czasow, to wsadz z przepisow +-16,(6)% int DefBrakeTable[8] = {15, 4, 25, 25, 13, 3, 12, 2}; - for (b = 1; b < 4; b++) + for (int b = 1; b < 4; b++) { if (BrakeDelay[b] == 0) BrakeDelay[b] = DefBrakeTable[b]; @@ -12739,7 +12737,6 @@ bool TMoverParameters::RunInternalCommand() // ************************************************************************************************* double TMoverParameters::ShowCurrentP(int AmpN) const { - int b; int Bn; bool Grupowy; @@ -12764,7 +12761,7 @@ double TMoverParameters::ShowCurrentP(int AmpN) const else // pobor pradu jezeli niema mocy { int current = 0; - for (b = 0; b < 2; b++) + for (int b = 0; b < 2; b++) // with Couplers[b] do if (TestFlag(Couplers[b].CouplingFlag, coupling::control) && Couplers[b].Connected->Power > 0.01) current = static_cast(Couplers[b].Connected->ShowCurrent(AmpN)); diff --git a/McZapkie/hamulce.cpp b/McZapkie/hamulce.cpp index 388d5881..a3867bfc 100644 --- a/McZapkie/hamulce.cpp +++ b/McZapkie/hamulce.cpp @@ -2055,7 +2055,6 @@ double TEStED::GetPF(double const PP, double const dt, double const Vel) void TEStED::Init(double const PP, double const HPP, double const LPP, double const BP, int const BDF) { TLSt::Init(PP, HPP, LPP, BP, BDF); - int i; ValveRes->CreatePress(PP); BrakeCyl->CreatePress(BP); @@ -2090,7 +2089,7 @@ void TEStED::Init(double const PP, double const HPP, double const LPP, double co Nozzles[6] = 0.9; { - for (i = 0; i < 11; ++i) + for (int i = 0; i < 11; ++i) { Nozzles[i] = Nozzles[i] * Nozzles[i] * 3.14159 / 4000; } diff --git a/rendering/flip-s3tc.h b/rendering/flip-s3tc.h index d842677a..ee05b73f 100644 --- a/rendering/flip-s3tc.h +++ b/rendering/flip-s3tc.h @@ -127,8 +127,6 @@ void flip_dxt45_block(struct dxt45_block *block) */ void flip_dxt1_image(void *data, int width, int height) { - int x; - int y; struct dxt1_block temp1; struct dxt1_block temp2; auto blocks = (struct dxt1_block *)data; @@ -136,9 +134,9 @@ void flip_dxt1_image(void *data, int width, int height) width = (width + 3) / 4; height = (height + 3) / 4; - for (y = 0; y < height / 2; ++y) + for (int y = 0; y < height / 2; ++y) { - for (x = 0; x < width; ++x) + for (int x = 0; x < width; ++x) { temp1 = blocks[y * width + x]; temp2 = blocks[(height - y - 1) * width + x]; @@ -158,8 +156,6 @@ void flip_dxt1_image(void *data, int width, int height) */ void flip_dxt23_image(void *data, int width, int height) { - int x; - int y; struct dxt23_block temp1; struct dxt23_block temp2; auto blocks = (struct dxt23_block *)data; @@ -167,9 +163,9 @@ void flip_dxt23_image(void *data, int width, int height) width = (width + 3) / 4; height = (height + 3) / 4; - for (y = 0; y < height / 2; ++y) + for (int y = 0; y < height / 2; ++y) { - for (x = 0; x < width; ++x) + for (int x = 0; x < width; ++x) { temp1 = blocks[y * width + x]; temp2 = blocks[(height - y - 1) * width + x]; @@ -189,8 +185,6 @@ void flip_dxt23_image(void *data, int width, int height) */ void flip_dxt45_image(void *data, int width, int height) { - int x; - int y; struct dxt45_block temp1; struct dxt45_block temp2; auto blocks = (struct dxt45_block *)data; @@ -198,9 +192,9 @@ void flip_dxt45_image(void *data, int width, int height) width = (width + 3) / 4; height = (height + 3) / 4; - for (y = 0; y < height / 2; ++y) + for (int y = 0; y < height / 2; ++y) { - for (x = 0; x < width; ++x) + for (int x = 0; x < width; ++x) { temp1 = blocks[y * width + x]; temp2 = blocks[(height - y - 1) * width + x]; diff --git a/world/Segment.cpp b/world/Segment.cpp index 8a5de5fb..512f1591 100644 --- a/world/Segment.cpp +++ b/world/Segment.cpp @@ -565,11 +565,10 @@ void TSegment::render_lines(std::vector &out, float quality) { float step = 1.0f / static_cast(iSegCount) / quality; - float x; glm::vec3 previous = FastGetPoint(0.0); - for (x = step; x <= 1.0f; x += step) { + for (float x = step; x <= 1.0f; x += step) { out.emplace_back(previous, glm::vec3(0.0f), glm::vec2(0.0f)); previous = glm::vec3(FastGetPoint(x)); @@ -586,12 +585,11 @@ glm::vec3 TSegment::get_nearest_point(const glm::dvec3 &point, float quality) co { float step = 1.0f / static_cast(iSegCount) / quality; - float x; glm::vec3 nearest; float min = std::numeric_limits::max(); - for (x = step; x <= 1.0f; x += step) { + for (float x = step; x <= 1.0f; x += step) { glm::vec3 p1 = FastGetPoint(x); if (glm::vec3 p2 = FastGetPoint(glm::min(1.0f, x + step)); p1 != p2) {