use static casts rather than C-style casting

C-style casting can result in undesired reinterpret_casts
So we should avoid them, see:
http://stackoverflow.com/questions/332030/when-should-static-cast-dynamic-cast-and-reinterpret-cast-be-used
Merge pull request #3 from wjwwood/timespec-refactor2

use static casts rather than C-style casting