dahtah / imager

R package for image processing
GNU Lesser General Public License v3.0
187 stars 43 forks source link

updated CImg.h and inpaint.h #113

Closed ShotaOchi closed 4 years ago

ShotaOchi commented 4 years ago

I updaded CImg.h and inapint.h. Then, I modified Makevars.in, Makevars.win, utils.cpp, and utils.R to fix warnings. FInally, I modified CImg.h to avoid a warning that seemed to be false positive. The modified part is line 7266-7268 and shown below.

if (*ext) cimg_snprintf(format,1024,"%%s_%%.%ud.%%s",digits);
else cimg_snprintf(format,1024,"%%s_%%.%ud",digits);
cimg_sprintf(str,format,body,number,ext);

The part shown above is modified as shown below.

if (*ext) {
  cimg_snprintf(format,1024,"%%s_%%.%ud.%%s",digits);
  cimg_sprintf(str,format,body,number,ext);
} else {
  cimg_snprintf(format,1024,"%%s_%%.%ud",digits);
  cimg_sprintf(str,format,body,number);
}
ShotaOchi commented 4 years ago

We should use the latest version of CImg.h because the main branch of CImg was updated and the warning "null format string" was fixed. Moreover, the modification of Makevars.in was terrible. That's why I close this pull request.