replaced c-style casts with c++ style for all of dafif library