enable buildoption -Wall by default; fix -Wunused-but-set-variable, -Wunused-function, -Wreorder
fix narrowing
Merge pull request #114 from darealshinji/patch-3

enable -Wall and fix compiler warnings