add -Wbad-function-cast to +CPPFLAGS and fix two compiler warnings