resolving c++ cast issues; but not tested
branch merge
replaced c-style casts with c++ style
replaced c-style casts with c++ style
replaced c-style casts with c++ style