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.
Merge pull request #1196 from zao/clang-warning-cleanup

Silence several warnings