added static cast to fix a clang compiler error under mac os x
Merge pull request #20 from dennycd/master

clang compiler error fix under mac os x