diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2010-04-20 10:30:40 -0700 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2010-04-20 10:30:40 -0700 |
commit | 707ed29d22cd973f07633a0ed82de10075d50edb (patch) | |
tree | 2f637fccf5a93a55b694db76ae7ddbf5c6ca880c /xts5 | |
parent | 4c32692b4acfb02d8ef9ebbe0b999a2a59bc2fd7 (diff) |
xts5: Fix "format 'blah' expects type 'blah' but argument has type 'blah'" warnings.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'xts5')
-rw-r--r-- | xts5/src/lib/dumpimage.c | 8 | ||||
-rw-r--r-- | xts5/src/lib/lookupname.c | 16 | ||||
-rw-r--r-- | xts5/src/lib/winh.c | 8 | ||||
-rw-r--r-- | xts5/src/libXR5/blowup.c | 2 | ||||
-rw-r--r-- | xts5/src/libXR5/message.c | 13 | ||||
-rw-r--r-- | xts5/src/libXtTest/check.c | 2 |
6 files changed, 25 insertions, 24 deletions
diff --git a/xts5/src/lib/dumpimage.c b/xts5/src/lib/dumpimage.c index 6c1c286f..a5ffdccb 100644 --- a/xts5/src/lib/dumpimage.c +++ b/xts5/src/lib/dumpimage.c @@ -152,9 +152,9 @@ static int lasttest; /* count is 0 on the first time through */ if (pix != lastpix || count == 0) { if (count == 1) { - fprintf(fp, "%x\n", lastpix); + fprintf(fp, "%lx\n", lastpix); } else if (count != 0) { - fprintf(fp, "%x,%x\n", count, lastpix); + fprintf(fp, "%lx,%lx\n", count, lastpix); } lastpix = pix; count = 1; @@ -164,9 +164,9 @@ static int lasttest; } } if (count == 1) { - fprintf(fp, "%x\n", lastpix); + fprintf(fp, "%lx\n", lastpix); } else if (count != 0) { - fprintf(fp, "%x,%x\n", count, lastpix); + fprintf(fp, "%lx,%lx\n", count, lastpix); } fclose(fp); } diff --git a/xts5/src/lib/lookupname.c b/xts5/src/lib/lookupname.c index 3e408870..642c3211 100644 --- a/xts5/src/lib/lookupname.c +++ b/xts5/src/lib/lookupname.c @@ -209,7 +209,7 @@ unsigned long masks; bp = (char*)malloc(size+sizeof("UNDEFINED BITS(0xffffffff)")); if (bp == (char*)0) { /* Just return the value */ - sprintf(buf, "(0x%x)", val); + sprintf(buf, "(0x%lx)", val); return(buf); } @@ -230,7 +230,7 @@ unsigned long masks; if (val & (~masks)) { if (*bp != 0) strcat(bp, "|"); - sprintf(buf, "UNDEFINED BITS(0x%x)", val & (~masks)); + sprintf(buf, "UNDEFINED BITS(0x%lx)", val & (~masks)); strcat(bp, buf); } return(bp); @@ -348,7 +348,7 @@ unsigned long masks; bp = (char*)malloc(size+sizeof("UNDEFINED BITS(0xffffffff)")); if (bp == (char*)0) { /* Just return the value */ - sprintf(buf, "(0x%x)", val); + sprintf(buf, "(0x%lx)", val); return(buf); } @@ -369,7 +369,7 @@ unsigned long masks; if (val & (~masks)) { if (*bp != 0) strcat(bp, "|"); - sprintf(buf, "UNDEFINED BITS(0x%x)", val & (~masks)); + sprintf(buf, "UNDEFINED BITS(0x%lx)", val & (~masks)); strcat(bp, buf); } return(bp); @@ -431,7 +431,7 @@ unsigned long masks; bp = (char*)malloc(size+sizeof("UNDEFINED BITS(0xffffffff)")); if (bp == (char*)0) { /* Just return the value */ - sprintf(buf, "(0x%x)", val); + sprintf(buf, "(0x%lx)", val); return(buf); } @@ -452,7 +452,7 @@ unsigned long masks; if (val & (~masks)) { if (*bp != 0) strcat(bp, "|"); - sprintf(buf, "UNDEFINED BITS(0x%x)", val & (~masks)); + sprintf(buf, "UNDEFINED BITS(0x%lx)", val & (~masks)); strcat(bp, buf); } return(bp); @@ -1307,7 +1307,7 @@ unsigned long masks; bp = (char*)malloc(size+sizeof("UNDEFINED BITS(0xffffffff)")); if (bp == (char*)0) { /* Just return the value */ - sprintf(buf, "(0x%x)", val); + sprintf(buf, "(0x%lx)", val); return(buf); } @@ -1328,7 +1328,7 @@ unsigned long masks; if (val & (~masks)) { if (*bp != 0) strcat(bp, "|"); - sprintf(buf, "UNDEFINED BITS(0x%x)", val & (~masks)); + sprintf(buf, "UNDEFINED BITS(0x%lx)", val & (~masks)); strcat(bp, buf); } return(bp); diff --git a/xts5/src/lib/winh.c b/xts5/src/lib/winh.c index 75c0b297..d57ff2fa 100644 --- a/xts5/src/lib/winh.c +++ b/xts5/src/lib/winh.c @@ -1286,16 +1286,16 @@ Winh *winh; (void) fprintf(stderr, "%sWindow: None", in); else - (void) fprintf(stderr, "%sWindow: 0x%x", - in, winh->window); + (void) fprintf(stderr, "%sWindow: 0x%lx", + in, (unsigned long)winh->window); if (winh->parent == (Winh *) NULL) (void) fprintf(stderr, ", Parent: None\n"); else - (void) fprintf(stderr, ", Parent: 0x%x\n",winh->parent->window); + (void) fprintf(stderr, ", Parent: 0x%lx\n", (unsigned long)winh->parent->window); (void) fprintf(stderr, "%sFirstborn: %s, Children: %2d\n", in, (FIRSTBORN(winh) ? "Yes" : "No "), winh->numchildren); - (void) fprintf(stderr, "%sValuemask: 0x%04x, Winhmask: 0x%04x\n", + (void) fprintf(stderr, "%sValuemask: 0x%04lx, Winhmask: 0x%04lx\n", in, winh->valuemask, winh->winhmask); if (winh->valuemask != 0) { diff --git a/xts5/src/libXR5/blowup.c b/xts5/src/libXR5/blowup.c index 63018b77..967f9af1 100644 --- a/xts5/src/libXR5/blowup.c +++ b/xts5/src/libXR5/blowup.c @@ -694,7 +694,7 @@ int compare_color; XDrawRectangle(vdisplay,window,rect_gc,start_x-windx,start_y-windy,pixels_across,pixels_across); if ((pixel_wrong)&&(show_color)) { - (void)sprintf(xypair, " Expect = %X ",expected_pixel); + (void)sprintf(xypair, " Expect = %lX ", expected_pixel); XDrawImageString(vdisplay, exp_win, textgc, 2, 10, xypair, 18); } else diff --git a/xts5/src/libXR5/message.c b/xts5/src/libXR5/message.c index 87f35d0f..de7e5a91 100644 --- a/xts5/src/libXR5/message.c +++ b/xts5/src/libXR5/message.c @@ -109,6 +109,7 @@ purpose. It is provided "as is" without express or implied warranty. #include <config.h> #endif +#include <inttypes.h> #include <stdio.h> #include <string.h> #include <r5structs.h> @@ -148,19 +149,19 @@ message(char *fmtstr, union msglst f_lst[], int f_cnt) tmpptr1 = &tmpstr1[0]; switch (char_type) { case 'd' : - (void)sprintf(tmpstr1,"%d",f_lst[i].typ_dec); + (void)sprintf(tmpstr1,"%ld", f_lst[i].typ_dec); break; case 'o' : - (void)sprintf(tmpstr1,"%o",f_lst[i].typ_oct); + (void)sprintf(tmpstr1,"%lo", f_lst[i].typ_oct); break; case 'x' : - (void)sprintf(tmpstr1,"%x",f_lst[i].typ_hex); + (void)sprintf(tmpstr1,"%lx", f_lst[i].typ_hex); break; case 'u' : - (void)sprintf(tmpstr1,"%u",f_lst[i].typ_uns); + (void)sprintf(tmpstr1,"%lu", f_lst[i].typ_uns); break; case 'c' : - (void)sprintf(tmpstr1,"%c",f_lst[i].typ_cha); + (void)sprintf(tmpstr1,"%c", f_lst[i].typ_cha); break; case 's' : tmpptr1 = f_lst[i].typ_str; @@ -172,7 +173,7 @@ message(char *fmtstr, union msglst f_lst[], int f_cnt) (void)sprintf(tmpstr1,"%e",f_lst[i].typ_dou); break; case 'a' : /* this is for addresses - type ADDRESS is regrdef.h */ - (void)sprintf(tmpstr1,"%u",f_lst[i].typ_adr); /* DEC address are unsigned long */ + (void)sprintf(tmpstr1,"%" PRIuPTR, (uintptr_t)f_lst[i].typ_adr); break; default: sprintf(ebuf, "Programming error calling message type %%%c not supported or\n",*fmtptr); diff --git a/xts5/src/libXtTest/check.c b/xts5/src/libXtTest/check.c index 248c0601..e8d57b3f 100644 --- a/xts5/src/libXtTest/check.c +++ b/xts5/src/libXtTest/check.c @@ -150,7 +150,7 @@ size_t ref_size; tet_infoline(ebuf); if (data_size != ref_size) { - sprintf(ebuf, "ERROR: Size of %s is %d, expected %d (size of %s)", data_object, data_size, ref_size, ref_object); + sprintf(ebuf, "ERROR: Size of %s is %zd, expected %zd (size of %s)", data_object, data_size, ref_size, ref_object); tet_infoline(ebuf); tet_result(TET_FAIL); return 1; |