Enable native win32 compilation with MSVS 2010 and CMake

  - move variable declarations to the top of the scope
  - avoid C99 structure member initialization (just a few)