diff options
author | Stéphane Aulery <saulery@free.fr> | 2014-11-08 18:00:26 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2014-11-17 14:31:49 +0100 |
commit | 6e81ca91fa8e62ca6fb5ba41c45bbd6a605d514c (patch) | |
tree | 23098f39c8e233100e892fd2615c2b4ee2c815b3 | |
parent | b1ad6e37beddb396f7cbd1fd1dca48036d85c016 (diff) | |
download | fbida-6e81ca91fa8e62ca6fb5ba41c45bbd6a605d514c.tar.gz |
Fix cppcheck warning %d in format string requires 'int' but the argument type is 'unsigned int'
Signed-off-by: Stéphane Aulery <saulery@free.fr>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r-- | browser.c | 4 | ||||
-rw-r--r-- | fbi.c | 2 | ||||
-rw-r--r-- | filebutton.c | 4 | ||||
-rw-r--r-- | ida.c | 14 | ||||
-rw-r--r-- | op.c | 2 | ||||
-rw-r--r-- | sane.c | 2 | ||||
-rw-r--r-- | selections.c | 2 | ||||
-rw-r--r-- | wr/write-ps.c | 12 |
8 files changed, 21 insertions, 21 deletions
@@ -117,10 +117,10 @@ browser_statfiles(XtPointer clientdata) /* update status line */ if (h->filter) { - snprintf(line, sizeof(line), "%d dirs, %d/%d files [%s]", + snprintf(line, sizeof(line), "%u dirs, %u/%u files [%s]", h->dirs,h->sfiles,h->afiles,h->filter); } else { - snprintf(line, sizeof(line), "%d dirs, %d files", + snprintf(line, sizeof(line), "%u dirs, %u files", h->dirs,h->afiles); } str = XmStringGenerate(line, NULL, XmMULTIBYTE_TEXT, NULL); @@ -1140,7 +1140,7 @@ static char *make_info(struct ida_image *img, float scale) static char linebuffer[128]; snprintf(linebuffer, sizeof(linebuffer), - "%s%.0f%% %dx%d %d/%d", + "%s%.0f%% %ux%u %d/%d", fcurrent->tag ? "* " : "", scale*100, img->i.width, img->i.height, diff --git a/filebutton.c b/filebutton.c index 3f922e2..b09d730 100644 --- a/filebutton.c +++ b/filebutton.c @@ -233,7 +233,7 @@ fileinfo_loader(XtPointer clientdata) } file->loader->done(file->wdata); if (debug) - fprintf(stderr,"LOADED: %s [%dx%d]\n", + fprintf(stderr,"LOADED: %s [%ux%u]\n", file->filename, file->wimg.i.width, file->wimg.i.height); /* resize image */ @@ -269,7 +269,7 @@ fileinfo_loader(XtPointer clientdata) } desc_resize.done(file->wdata); if (debug) - fprintf(stderr,"SCALED: %s [%dx%d]\n", + fprintf(stderr,"SCALED: %s [%ux%u]\n", file->filename,file->simg.i.width,file->simg.i.height); /* scale once more (small icon) */ @@ -726,13 +726,13 @@ resize_shell(void) else base = ida->file; title = malloc(strlen(base)+128); - len = sprintf(title,"%s (%dx%d", base, + len = sprintf(title,"%s (%ux%u", base, ida->img.i.width, ida->img.i.height); if (ida->img.i.dpi) - len += sprintf(title+len," | %d dpi", + len += sprintf(title+len," | %u dpi", ida->img.i.dpi); if (ida->img.i.npages > 1) - len += sprintf(title+len," | page %d/%d", + len += sprintf(title+len," | page %d/%u", cpage+1, ida->img.i.npages); len += sprintf(title+len," | %d%%)", viewer_i2s(ida->zoom,100)); XtVaSetValues(app_shell, XtNtitle,title, @@ -1593,7 +1593,7 @@ resize_sync_cb(Widget widget, XtPointer client_data, XtPointer calldata) /* radio buttons pressed */ if (h->size == widget && XmToggleButtonGetState(h->size)) { XmToggleButtonSetState(h->res,0,False); - sprintf(buf,"%d", ida->img.i.dpi); + sprintf(buf,"%u", ida->img.i.dpi); h->rupdate++; XmTextSetString(h->tr,buf); XtVaSetValues(h->tr,XmNsensitive,False,NULL); @@ -1671,11 +1671,11 @@ resize_ac(Widget widget, XEvent *event, String *params, Cardinal *num) h->label = XtVaCreateManagedWidget("label", xmLabelWidgetClass, rc, NULL); - sprintf(buf,"%d",ida->img.i.width); + sprintf(buf,"%u",ida->img.i.width); XmTextSetString(h->tx,buf); - sprintf(buf,"%d",ida->img.i.height); + sprintf(buf,"%u",ida->img.i.height); XmTextSetString(h->ty,buf); - sprintf(buf,"%d",ida->img.i.dpi); + sprintf(buf,"%u",ida->img.i.dpi); XmTextSetString(h->tr,buf); XtVaSetValues(h->tr,XmNsensitive,False,NULL); XmToggleButtonSetState(h->lock,1,False); @@ -215,7 +215,7 @@ op_autocrop_init(struct ida_image *src, struct ida_rect *unused, free(img.data); if (debug) - fprintf(stderr,"y: %d-%d/%d -- x: %d-%d/%d\n", + fprintf(stderr,"y: %d-%d/%u -- x: %d-%d/%u\n", rect.y1, rect.y2, img.i.height, rect.x1, rect.x2, img.i.width); @@ -243,7 +243,7 @@ sane_idainit(FILE *fp, char *filename, unsigned int page, struct ida_image_info info->dpi = dpi; h->buf = malloc(h->parm.bytes_per_line * BUF_LINES); if (debug) - fprintf(stderr,"sane: scanning %dx%d %s\n",info->width,info->height, + fprintf(stderr,"sane: scanning %ux%u %s\n",info->width,info->height, (h->parm.format == SANE_FRAME_GRAY) ? "gray" : "color"); return h; diff --git a/selections.c b/selections.c index 10a2617..26edf20 100644 --- a/selections.c +++ b/selections.c @@ -307,7 +307,7 @@ selection_convert(Widget widget, XtPointer ignore, XtPointer call_data) } else if (ccs->target == MIME_IMAGE_PPM) { /* xfer image data directly */ cdata = XtMalloc(sel->img.i.width * sel->img.i.height * 3 + 32); - n = sprintf(cdata,"P6\n%d %d\n255\n", + n = sprintf(cdata,"P6\n%u %u\n255\n", sel->img.i.width, sel->img.i.height); memcpy(cdata+n, sel->img.data, sel->img.i.width*sel->img.i.height*3); ccs->value = cdata; diff --git a/wr/write-ps.c b/wr/write-ps.c index 914a896..ee34988 100644 --- a/wr/write-ps.c +++ b/wr/write-ps.c @@ -415,20 +415,20 @@ ps_write(FILE *fp, struct ida_image *img) fprintf(fp,header, /* includes bbox */ xoff,yoff,xoff+width,yoff+height); fprintf(fp,"\n" - "/pix %d string def\n" - "/grays %d string def\n" + "/pix %u string def\n" + "/grays %u string def\n" "/npixls 0 def\n" "/rgbindx 0 def\n" "\n", img->i.width*3,img->i.width); fwrite(ColorImage,strlen(ColorImage),1,fp); - fprintf(fp,"%d %d translate\n",xoff,yoff); - fprintf(fp,"%d %d scale\n",width,height); + fprintf(fp,"%u %u translate\n",xoff,yoff); + fprintf(fp,"%u %u scale\n",width,height); fprintf(fp,"\n" - "%d %d 8\n" - "[%d 0 0 -%d 0 %d]\n" + "%u %u 8\n" + "[%u 0 0 -%u 0 %u]\n" "{currentfile pix readhexstring pop}\n" "false 3 colorimage\n", iwidth,iheight,iwidth,iheight,iheight); |