fix most of the compiler warnings

except strict-aliasing warnings when using libev API
Merge pull request #49 from avsej/fix-compiler-warnings

fix most of the compiler warnings