Fix Windows warnings

This fixes problems with missing function prototypes and 64-bit
data issues on Windows.
Merge pull request #1647 from arrbee/fix-win32-warnings-part-112

Fix Windows warnings and missing prototypes