fix some notices: remove unused variables or include them in debug if define
change deprecated types for newer gcc versions
fix missing return values (compiler notices)