various fixes for C89 compliance. also stripped some line-trailing spaces.