improving code quality to enable -Wall with minor discounts

improving code quality to enable -Wall with minor discounts
I doubt that adding const to methods has anything to do with -Wall passing or not.
separate commit?