minor corrections for better C++ compliance

Minor corrections to various function definitions for better
compatibility and portability across difference platforms.