From f97e5cb77c7141c75f5ca7d0793f75785471a17b Mon Sep 17 00:00:00 2001 From: jpekkila Date: Tue, 3 Dec 2019 18:41:08 +0200 Subject: [PATCH] Fixed parts which caused a shadowing warning (same variable name used for different variables in the same scope) --- src/standalone/autotest.cc | 2 +- src/standalone/simulation.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/standalone/autotest.cc b/src/standalone/autotest.cc index 76f5a63..57ef696 100644 --- a/src/standalone/autotest.cc +++ b/src/standalone/autotest.cc @@ -422,7 +422,7 @@ check_rk3(const AcMeshInfo& mesh_info) acBoundcondStep(); boundconds(model_mesh->info, model_mesh); - for (int i = 0; i < num_iterations; ++i) { + for (int j = 0; j < num_iterations; ++j) { // const AcReal umax = AcReal(acReduceVec(RTYPE_MAX, VTXBUF_UUX, VTXBUF_UUY, // VTXBUF_UUZ)); // const AcReal dt = host_timestep(umax, mesh_info); diff --git a/src/standalone/simulation.cc b/src/standalone/simulation.cc index 8897a92..f1644da 100644 --- a/src/standalone/simulation.cc +++ b/src/standalone/simulation.cc @@ -127,8 +127,8 @@ save_mesh(const AcMesh& save_mesh, const int step, const AcReal t_step) // Grid data for (size_t i = 0; i < n; ++i) { const AcReal point_val = save_mesh.vertex_buffer[VertexBufferHandle(w)][i]; - AcReal write_long_buf = (AcReal)point_val; - fwrite(&write_long_buf, sizeof(AcReal), 1, save_ptr); + AcReal write_long_buf2 = (AcReal)point_val; + fwrite(&write_long_buf2, sizeof(AcReal), 1, save_ptr); } fclose(save_ptr); }