remove trailing white space

remove trailing white space in the whole project, which is separated from the pull request #880 suggested by @badboy. 

I have run "make test". The result shows everything is correct.