The static code analyzer cppcheck warns about unsigned integers
which use "%d" in the format string.
It also warns about an unneeded assignment.
Fix both issues.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
}
}
strncpy(name, outfile, dotpos);
}
}
strncpy(name, outfile, dotpos);
- sprintf(name+dotpos, "_%d.pgx", compno);
+ sprintf(name+dotpos, "_%u.pgx", compno);
fdest = fopen(name, "wb");
/* don't need name anymore */
fdest = fopen(name, "wb");
/* don't need name anymore */
s = skip_white(start);
if(s == NULL) return NULL;
s = skip_white(start);
if(s == NULL) return NULL;
{
const char *tt = (triple?"RGB_ALPHA":"GRAYSCALE_ALPHA");
{
const char *tt = (triple?"RGB_ALPHA":"GRAYSCALE_ALPHA");
- fprintf(fdest, "P7\n# OpenJPEG-%s\nWIDTH %d\nHEIGHT %d\nDEPTH %d\n"
+ fprintf(fdest, "P7\n# OpenJPEG-%s\nWIDTH %d\nHEIGHT %d\nDEPTH %u\n"
"MAXVAL %d\nTUPLTYPE %s\nENDHDR\n", opj_version(),
wr, hr, ncomp, max, tt);
alpha = image->comps[ncomp - 1].data;
"MAXVAL %d\nTUPLTYPE %s\nENDHDR\n", opj_version(),
wr, hr, ncomp, max, tt);
alpha = image->comps[ncomp - 1].data;
const size_t dotpos = olen - 4;
strncpy(destname, outfile, dotpos);
const size_t dotpos = olen - 4;
strncpy(destname, outfile, dotpos);
- sprintf(destname+dotpos, "_%d.pgm", compno);
+ sprintf(destname+dotpos, "_%u.pgm", compno);
}
else
sprintf(destname, "%s", outfile);
}
else
sprintf(destname, "%s", outfile);
for(compno = 0; compno < image->numcomps; compno++)
{
for(compno = 0; compno < image->numcomps; compno++)
{
- fprintf(stdout,"Component %d characteristics: %dx%dx%d %s\n", compno, image->comps[compno].w,
+ fprintf(stdout,"Component %u characteristics: %dx%dx%d %s\n", compno, image->comps[compno].w,
image->comps[compno].h, image->comps[compno].prec, image->comps[compno].sgnd==1 ? "signed": "unsigned");
w = (int)image->comps[compno].w;
image->comps[compno].h, image->comps[compno].prec, image->comps[compno].sgnd==1 ? "signed": "unsigned");
w = (int)image->comps[compno].w;