C89-compatible code

Changed the code to compile with zero errors/warnings when compiled using "-ansi
-pedantic"