Merge pull request #23 from rui314/c99

Start using C99
Added port attributes
Typo fix
Convert more files to C99.