]> granicus.if.org Git - graphviz/commitdiff
xlib plugin update_display: squash -Wsign-conversion warning for window depth
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Wed, 30 Mar 2022 15:26:36 +0000 (08:26 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 2 Apr 2022 19:55:48 +0000 (12:55 -0700)
plugin/xlib/gvdevice_xlib.c

index 0eb15118bc950125b8727f5fcee39cff478e5f23..0098be6cde1a65c039b3645116b356b5ddd12895 100644 (file)
@@ -253,8 +253,10 @@ static void update_display(GVJ_t *job, Display *dpy)
 
     if (job->has_grown) {
        XFreePixmap(dpy, window->pix);
+       assert(window->depth >= 0 && "Xlib returned invalid window depth");
        window->pix = XCreatePixmap(dpy, window->win,
-                       job->width, job->height, window->depth);
+                                   job->width, job->height,
+                                   (unsigned)window->depth);
        job->has_grown = false;
        job->needs_refresh = true;
     }