Fixup filenames in comments; remove dead code found with scan-build.

Sorry, this probably should be two different PRs...

The `.c` -> `.cpp` stuff should be self-explanatory.

The rest is removal of dead code found with the clang static analyzer. It definitely is, presently, all dead code - I can see no functionality change, and all tests pass - but whether its _supposed_ to be doing something, I don't know. So you may wish to look over those.

~G