fix c++ compile warnings