ANSI / C89 compatibility

Used clang -pedantic -std=c89 to identify areas that weren't compatible with c89 so that we can build on older versions of Visual Studio. Made the appropriate changes from the warnings