SciCompMod / GMGPolar

High Order Geometric Multigrid for planes in curvilinear coordinates
Apache License 2.0
14 stars 0 forks source link

Avoid shadowing of variables through for loops #16

Open mknaranja opened 1 year ago

mknaranja commented 1 year ago

In some occasions, we use a variable like j to be redefined multiple times inside a function while it is also used inside loops. This gives warnings like:

smoother.cpp", line 1652: warning: reference is to variable "j" (declared at line 1033) -- under old for-init scoping rules it would have been variable "j" (declared at line 1335) [hidden_by_old_for_init]
                      col = (j + 1) * ntheta_int + i;

which we should avoid by not using the same variable in two occasions redefined again and again.