Fix 64-bit issues and compiler warnings.

Enabled -Werror on a 64-bit host build (BUILD_HOST_64bit=1), ignored
unused parameter warnings and then cleaned up what remained. The most
concerning issue was always true comparisons caused by comparing an
unsigned int with a size_t.

Migrate C++ code to use C++11.
35 files changed