Make type casts safer

There have many type mismatched, legacy code in src/dump.c. This will fix them.
And this PR includes a patch for more strict warning checks.