Fix compiler warnings

This set of commits fixes all compiler warnings in OSX build except for 2 in the qupgrade submodule. I have fixes for those as well but I need to learn more about git submodules to figure out how to commit them. With those remaining two, if someone could check linux and windows builds the codebase should be pretty close to being able to switch to warnings as errors so they don't creep back in. Once I cleaned my way through I did end up with a set of real bugs founds by the warnings which I fixed, but were being hidden by the 100+ false positives. Easy to keep clean once it's clean one time.