[Xcb-commit] xcb-demo

Josh Triplett josh at kemper.freedesktop.org
Fri Apr 28 12:18:43 PDT 2006


 xcb-demo/hypnomoire.c    |    4 ++--
 xcb-demo/rendertest.c    |   16 ++++++++--------
 xcb-demo/reply_formats.c |    4 ++--
 xcb-demo/xcbrandr.c      |    2 +-
 xcb-demo/xcbxvinfo.c     |   14 +++++++-------
 5 files changed, 20 insertions(+), 20 deletions(-)

New commits:
diff-tree c7a2218d73922cc8017720caca6c349967e91e31 (from ad40c4762e625657c62ba207a77ed8b07f6a6a7e)
Author: Josh Triplett <josh at freedesktop.org>
Date:   Fri Apr 28 12:18:39 2006 -0700

    Fix more format string integer size warnings.

diff --git a/xcb-demo/hypnomoire.c b/xcb-demo/hypnomoire.c
index ffd4a5e..b9746a2 100644
--- a/xcb-demo/hypnomoire.c
+++ b/xcb-demo/hypnomoire.c
@@ -50,8 +50,8 @@ static void get_depth()
 	}
 
 	depth = geom->depth;
-	fprintf(stderr, "Root 0x%lx: %dx%dx%d\n",
-		 root->root.xid, geom->width, geom->height, geom->depth);
+	fprintf(stderr, "Root 0x%x: %dx%dx%d\n",
+	        root->root.xid, geom->width, geom->height, geom->depth);
 	free(geom);
 }
 
diff --git a/xcb-demo/rendertest.c b/xcb-demo/rendertest.c
index 1daf5a7..d738288 100644
--- a/xcb-demo/rendertest.c
+++ b/xcb-demo/rendertest.c
@@ -26,7 +26,7 @@ XCBRenderFIXED make_fixed(INT16 i, INT16
 void print_version_info(XCBRenderQueryVersionRep *reply)
 {
     
-    fprintf(stdout, "Render Version: %ld.%ld\n", reply->major_version, 
+    fprintf(stdout, "Render Version: %d.%d\n", reply->major_version, 
             reply->minor_version);
 }
 
@@ -53,7 +53,7 @@ int print_formats_info(XCBRenderQueryPic
         XCBRenderPICTFORMINFO *forminfo = (XCBRenderPICTFORMINFO *)forminfo_iter.data;
 
         fprintf(stdout, "PICTFORMINFO #%d\n", 1 + num_formats - forminfo_iter.rem);
-        fprintf(stdout, "    PICTFORMAT ID:          %ld\n", forminfo->id.xid);
+        fprintf(stdout, "    PICTFORMAT ID:          %d\n", forminfo->id.xid);
         fprintf(stdout, "    PICTFORMAT Type:        %d\n", forminfo->type);
         fprintf(stdout, "    PICTFORMAT Depth:       %d\n", forminfo->depth);
         fprintf(stdout, "        Direct RedShift:    %d\n", forminfo->direct.red_shift);
@@ -75,8 +75,8 @@ int print_formats_info(XCBRenderQueryPic
         XCBRenderPICTSCREEN *cscreen = screen_iter.data;
         
         fprintf(stdout, "Screen #%d\n", 1 + num_screens - screen_iter.rem);
-        fprintf(stdout, "    Depths for this screen:    %ld\n", cscreen->num_depths);
-        fprintf(stdout, "    Fallback PICTFORMAT:       %ld\n", cscreen->fallback.xid);
+        fprintf(stdout, "    Depths for this screen:    %d\n", cscreen->num_depths);
+        fprintf(stdout, "    Fallback PICTFORMAT:       %d\n", cscreen->fallback.xid);
         depth_iter = XCBRenderPICTSCREENDepthsIter(cscreen);
 
         num_depths = cscreen->num_depths;
@@ -96,8 +96,8 @@ int print_formats_info(XCBRenderQueryPic
                 XCBRenderPICTVISUAL *cvisual = visual_iter.data;
                 
                 fprintf(stdout, "        Visual #%d\n", 1 + num_visuals - visual_iter.rem);
-                fprintf(stdout, "            VISUALID:      %ld\n", cvisual->visual.id);
-                fprintf(stdout, "            PICTFORMAT:    %ld\n", cvisual->format.xid);
+                fprintf(stdout, "            VISUALID:      %d\n", cvisual->visual.id);
+                fprintf(stdout, "            PICTFORMAT:    %d\n", cvisual->format.xid);
                 XCBRenderPICTVISUALNext(&visual_iter);
             }
             XCBRenderPICTDEPTHNext(&depth_iter);
@@ -542,10 +542,10 @@ int main(int argc, char *argv[])
     forminfo_query.direct.alpha_mask = 255;
     
     forminfo_result = get_pictforminfo(formats_reply, &forminfo_query);
-    fprintf(stdout, "\n***** found PICTFORMAT:  %ld *****\n",
+    fprintf(stdout, "\n***** found PICTFORMAT:  %d *****\n",
             forminfo_result->id.xid);
     rootformat = get_pictformat_from_visual(formats_reply, root->root_visual);
-    fprintf(stdout, "\n***** found root PICTFORMAT:   %ld *****\n", rootformat.xid);
+    fprintf(stdout, "\n***** found root PICTFORMAT:   %d *****\n", rootformat.xid);
    
 #if 0
     draw_window(c, formats_reply);
diff --git a/xcb-demo/reply_formats.c b/xcb-demo/reply_formats.c
index 7920f3f..bb25108 100644
--- a/xcb-demo/reply_formats.c
+++ b/xcb-demo/reply_formats.c
@@ -24,8 +24,8 @@ int formatGetWindowAttributesReply(XCBWI
            "    class              = %d\n"
            "    bitGravity         = %d\n"
            "    winGravity         = %d\n"
-           "    backingBitPlanes   = 0x%08lx\n"
-           "    backingPixel       = %ld\n"
+           "    backingBitPlanes   = 0x%08x\n"
+           "    backingPixel       = %d\n"
            "    saveUnder          = %d\n"
            "    mapInstalled       = %d\n"
            "    mapState           = %d\n"
diff --git a/xcb-demo/xcbrandr.c b/xcb-demo/xcbrandr.c
index 17aab3f..f3d84e2 100644
--- a/xcb-demo/xcbrandr.c
+++ b/xcb-demo/xcbrandr.c
@@ -417,7 +417,7 @@ main (int argc, char **argv)
 	  printf(" window = %d\n root = %d\n size_index = %d\n rotation %d\n", 
 	       (int) sce->request_window.xid, (int) sce->root.xid, 
 	       sce->sizeID,  sce->rotation);
-	  printf(" timestamp = %ld, config_timestamp = %ld\n",
+	  printf(" timestamp = %d, config_timestamp = %d\n",
 	       sce->timestamp, sce->config_timestamp);
 	  printf(" Rotation = %x\n", sce->rotation);
 	  printf(" %d X %d pixels, %d X %d mm\n",
diff --git a/xcb-demo/xcbxvinfo.c b/xcb-demo/xcbxvinfo.c
index 0f9a363..3285cea 100644
--- a/xcb-demo/xcbxvinfo.c
+++ b/xcb-demo/xcbxvinfo.c
@@ -113,7 +113,7 @@ int main(int argc, char *argv[])
             name = ExtractString(XCBXvAdaptorInfoName(ainfo), XCBXvAdaptorInfoNameLength(ainfo));
             fprintf(stdout, "  Adaptor #%i: \"%s\"\n", j, name);
             fprintf(stdout, "    number of ports: %i\n", ainfo->num_ports);
-            fprintf(stdout, "    port base: %li\n", ainfo->base_id.xid);
+            fprintf(stdout, "    port base: %i\n", ainfo->base_id.xid);
             fprintf(stdout, "    operations supported: ");
             free(name);
 
@@ -142,7 +142,7 @@ int main(int argc, char *argv[])
 
             fprintf(stdout, "    supported visuals:\n");
             for (k=0; k < ainfo->num_formats; k++, format++)
-                fprintf(stdout, "      depth %i, visualID 0x%2lx\n",
+                fprintf(stdout, "      depth %i, visualID 0x%2x\n",
                         format->depth, format->visual.id);
 
             attr_rep = XCBXvQueryPortAttributesReply(c,
@@ -155,7 +155,7 @@ int main(int argc, char *argv[])
 
                 for (k = 0; k < nattr; k++) {
                     attribute = attr_iter.data;
-                    fprintf(stdout, "      \"%s\" (range %li to %li)\n",
+                    fprintf(stdout, "      \"%s\" (range %i to %i)\n",
                             XCBXvAttributeInfoName(attribute),
                             attribute->min,
                             attribute->max);
@@ -183,7 +183,7 @@ int main(int argc, char *argv[])
                                 XCBXvGetPortAttributeReply(c,
                                         XCBXvGetPortAttribute(c, ainfo->base_id, the_atom),
                                         NULL);
-                            if (pattr_rep) fprintf(stdout, " (current value is %li)", pattr_rep->value);
+                            if (pattr_rep) fprintf(stdout, " (current value is %i)", pattr_rep->value);
                             free(pattr_rep);
                         }
                         fprintf(stdout, "\n");
@@ -224,7 +224,7 @@ int main(int argc, char *argv[])
                         name = ExtractString(XCBXvEncodingInfoName(encoding), XCBXvEncodingInfoNameLength(encoding));
                         if(nstrcmp(name, strlen(name), "XV_IMAGE")) {
                             fprintf(stdout,
-                                    "      encoding ID #%li: \"%*s\"\n",
+                                    "      encoding ID #%i: \"%*s\"\n",
                                     encoding->encoding.xid,
                                     strlen(name),
                                     name);
@@ -268,7 +268,7 @@ int main(int argc, char *argv[])
                     for(n = 0; n < numImages; n++) {
                         format = formats_iter.data;
                         memcpy(imageName, &(format->id), 4);
-                        fprintf(stdout, "      id: 0x%lx", format->id);
+                        fprintf(stdout, "      id: 0x%x", format->id);
                         if(isprint(imageName[0]) && isprint(imageName[1]) &&
                                 isprint(imageName[2]) && isprint(imageName[3])) 
                         {
@@ -323,7 +323,7 @@ int main(int argc, char *argv[])
                                     format->depth);
 
                             fprintf(stdout, "        red, green, blue masks: " 
-                                    "0x%lx, 0x%lx, 0x%lx\n", 
+                                    "0x%x, 0x%x, 0x%x\n", 
                                     format->red_mask,
                                     format->green_mask,
                                     format->blue_mask);


More information about the xcb-commit mailing list