Fix incorrect initialization of thread_storage_key in Windows
Fix warnings
Use integer arithmetic instead of floating point operations and fix problems in C++
Update Visual Studio project