Rename variable to avoid shadowing.
Suppress unused argument warning in release mode.
Avoid using VLAs (C99 feature).

Regular C fixed-size arrays are sufficient here, although in general
std::vector is the preferred replacement (if needing the dynamic size).
Make compatible with C++98, silence warnings.
Merge pull request #692 from atgeirr/fix-mirror-grid

Make compatible with C++98, silence warnings.
Merge pull request #690 from atgeirr/fix-warnings

Fix warnings