]> granicus.if.org Git - graphviz/commitdiff
WebP plugin: remove unnecessary casts
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 31 Mar 2022 03:24:14 +0000 (20:24 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 2 Apr 2022 00:07:11 +0000 (17:07 -0700)
plugin/webp/gvdevice_webp.c
plugin/webp/gvloadimage_webp.c

index 573c6365176824e7ea0fdd42f2b9467dcb8940cc..4331a8229b8dddc86afdc0e9d4431e7692ef8f50 100644 (file)
@@ -40,7 +40,7 @@ typedef enum {
 } format_type;
 
 static int writer(const uint8_t* data, size_t data_size, const WebPPicture* const pic) {
-    return (gvwrite((GVJ_t *)pic->custom_ptr, (const char *)data, data_size) == data_size) ? 1 : 0;
+    return (gvwrite(pic->custom_ptr, (const char *)data, data_size) == data_size) ? 1 : 0;
 }
 
 static void webp_format(GVJ_t * job)
@@ -60,7 +60,7 @@ static void webp_format(GVJ_t * job)
     stride = 4 * job->width;
 
     picture.writer = writer;
-    picture.custom_ptr = (void*)job;
+    picture.custom_ptr = job;
 
     preset = WEBP_PRESET_DRAWING;
 
index 7b4c10153c90378188b21e27dbde99a008ab38a2..58a29bd3001bfbb2705c8f75fbb2f0049a523a97 100644 (file)
@@ -159,7 +159,7 @@ static cairo_surface_t* webp_loadimage(GVJ_t * job, usershape_t *us)
 /* paint image into required location in graph */
 static void webp_loadimage_cairo(GVJ_t * job, usershape_t *us, boxf b, bool filled)
 {
-    cairo_t *cr = (cairo_t *) job->context; /* target context */
+    cairo_t *cr = job->context; /* target context */
     cairo_surface_t *surface;   /* source surface */
 
     surface = webp_loadimage(job, us);