fix C compiler warnings reported by CRAN