fix Issue 10005 - struct variable declaration and const-correctness
Merge pull request #1948 from 9rnsr/fix10005

Issue 10005 - struct variable declaration and const-correctness