HPCC-11846 Fix various clang warnings

Signed-off-by: Gavin Halliday <gavin.halliday@lexisnexis.com>
Is the idea of this change to better ensure the compiler doesn't optimize away? Or did it just remove a warning?
Could the compiler optimizer this away?