eliminate clang warnings

Here are some changes that eliminate clang (OSX 10.8.5 cc) warnings.

Apple LLVM version 5.0 (clang-500.2.75) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin12.5.0

The changes work for me; you may want to generalize the test for __APPLE__ defined. I suspect it is correct and warranted for most platforms.