]> granicus.if.org Git - graphviz/commitdiff
gdk plugin: remove unnecessary casts around 'us->data'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 26 Nov 2021 17:50:53 +0000 (09:50 -0800)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 3 Dec 2021 01:12:49 +0000 (17:12 -0800)
plugin/gdk/gvloadimage_gdk.c

index 03dd3b421abf4351b78c7df59cca40cfa5836e90..bf2e107affe3c9c7393e95ee25691a06a31fc785 100644 (file)
@@ -102,9 +102,9 @@ static void gdk_set_mimedata(cairo_surface_t *image, usershape_t *us)
 static void gdk_freeimage(usershape_t *us)
 {
 #ifndef HAVE_CAIRO_SURFACE_SET_MIME_DATA
-    g_object_unref((GdkPixbuf*)(us->data));
+    g_object_unref(us->data);
 #else /* HAVE_CAIRO_SURFACE_SET_MIME_DATA */
-    cairo_surface_destroy ((cairo_surface_t *)(us->data));
+    cairo_surface_destroy(us->data);
 #endif /* HAVE_CAIRO_SURFACE_SET_MIME_DATA */
 }
 
@@ -130,7 +130,7 @@ static cairo_surface_t* gdk_loadimage(GVJ_t * job, usershape_t *us)
     if (us->data) {
 #ifndef HAVE_CAIRO_SURFACE_SET_MIME_DATA
         if (us->datafree == gdk_freeimage)
-             image = (GdkPixbuf*)(us->data); /* use cached data */
+             image = us->data; /* use cached data */
         else {
              us->datafree(us);        /* free incompatible cache data */
              us->datafree = NULL;
@@ -171,7 +171,7 @@ static cairo_surface_t* gdk_loadimage(GVJ_t * job, usershape_t *us)
 #endif /* HAVE_CAIRO_SURFACE_SET_MIME_DATA */
         if (image) {
 #ifndef HAVE_CAIRO_SURFACE_SET_MIME_DATA
-            us->data = (void*)image;
+            us->data = image;
 #else /* HAVE_CAIRO_SURFACE_SET_MIME_DATA */
             cairo_save (cr);
             gdk_cairo_set_source_pixbuf (cr, image, 0, 0);
@@ -181,7 +181,7 @@ static cairo_surface_t* gdk_loadimage(GVJ_t * job, usershape_t *us)
             cairo_image = cairo_surface_reference (cairo_image);
             cairo_restore (cr);
             gdk_set_mimedata (cairo_image, us);
-            us->data = (void*)cairo_surface_reference (cairo_image);
+            us->data = cairo_surface_reference(cairo_image);
 #endif /* HAVE_CAIRO_SURFACE_SET_MIME_DATA */
             us->datafree = gdk_freeimage;
         }