Fix printf formats, remove unused variables, add missing prototypes in slapd, add static/const, add some return types or change to void return type.