Feature parity with C++, now ANSI-compatible

I broke ANSI compatibility when switching from gcc to clang, and couldn't figure out how to get it to warn me about variable declarations in loops and mixing code and declarations. Turns out it's the -ansi flag. Also attempted to clean up the code style a bit, to match the C++ version.