Cleanup of various C errors in VS 2010

Attempted to compile every C language code file and fix its warning. I
gave up on casting problems, but have hopefully improved the code
otherwise.