Silence several warnings

Some warnings have been lingering around for a long time, and some
warnings are new. In order to actually spot new problems in the stream
of noise, the code is audited and mitigated where it's spurious
warnings.

The warnings addressed are mostly unused fields, unused variables and
tautological compares.