some little modifications of C++ syntax

- remove commas at last element

- remove useless semicolons followed by functions decalerations

- remove trailing spaces