Fixed yet more compiler warnings from g++ -Wall

Patched various loop variables to avoid signed/unsigned comparisons.
Used void-cast in place of dummy assignments from functions with side-effects.
Tidied class member-initializations to avoid #pragma clang diagnostic push.
Removed selected unused variables to avoid "#pragma unused".
(Remaining warnings are generally more subtle.)