Mikktspace.c could have lot of warnings removed on Visual Studio

Hi,
I think it can be nice to clean the Mikktspace.c to remove all the warnings from Visual Studio:

mikktspace.c(443,1): warning C4204: nonstandard extension used: non-constant aggregate initializer
mikktspace.c(444,1): warning C4204: nonstandard extension used: non-constant aggregate initializer
mikktspace.c(703,33): warning C4456: declaration of ‘distSQ_02’ hides previous local declaration
mikktspace.c(691,21): message : see declaration of ‘distSQ_02’
mikktspace.c(704,33): warning C4456: declaration of ‘distSQ_13’ hides previous local declaration
mikktspace.c(692,21): message : see declaration of ‘distSQ_13’
mikktspace.c(812,4): warning C4201: nonstandard extension used: nameless struct/union
mikktspace.c(1231,17): warning C4456: declaration of ‘s’ hides previous local declaration
mikktspace.c(1149,31): message : see declaration of ‘s’
mikktspace.c(1486,17): warning C4456: declaration of ‘f’ hides previous local declaration
mikktspace.c(1440,42): message : see declaration of ‘f’
mikktspace.c(1523,15): warning C4456: declaration of ‘t’ hides previous local declaration
mikktspace.c(1501,22): message : see declaration of ‘t’
mikktspace.c(1600,19): warning C4456: declaration of ‘index’ hides previous local declaration
mikktspace.c(1581,18): message : see declaration of ‘index’
mikktspace.c(1724,29): warning C4456: declaration of ‘bIsGood’ hides previous local declaration
mikktspace.c(1714,17): message : see declaration of ‘bIsGood’
mikktspace.c(1883,25): warning C4456: declaration of ‘i’ hides previous local declaration
mikktspace.c(1845,14): message : see declaration of ‘i’

All the best :slight_smile:

I have tried vs2015/2017/2019 and I’m not seeing any of these with our default settings. I suspect you may have raised your warning level?

Visual Studio 2019 with warning level 4.

Our default configuration out of the box is W3, if you enable W4 you indeed are going to have lots and lots (and i mean lots) of extra warnings. We’re not even W3 clean (yet) , enabling W4 at this point is not something I can recommend doing.