Clang 3.0: Fixed a bunch of warnings at high warning levels.

Flags used: -Wall -Wextra -Weverything -pedantic -Werror
-Wno-exit-time-destructors -Wno-global-constructors -Wno-padded -Wno-weak-vtables