Warnings: Fix several warnings.

Deleting a void* (which won't do anything on c++0x).
Comparing int to NULL or nullptr.
Setting ints to NULL;
Passing int to a function expecting a pointer.
Initialising externs and having two externs instead of a definition.
Having a class member with the same name as another class. It was unused anyway.
Remove some TODO: remove me such as -fpermissive and -w in CMake.