]> granicus.if.org Git - graphviz/commitdiff
Ghostscript plugin: remove unnecessary casts
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sun, 3 Apr 2022 20:03:47 +0000 (13:03 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 7 Apr 2022 13:46:40 +0000 (06:46 -0700)
plugin/gs/gvloadimage_gs.c

index 6ddb89da293d815988f15362b3e27b040a7cfd2a..c571c6e907d7c369b722d670b3018fd4211a3236 100644 (file)
@@ -62,7 +62,7 @@ static void gvloadimage_gs_free(usershape_t *us)
 
 static int gs_writer(void *caller_handle, const char *str, int len)
 {
-    GVJ_t *job = (GVJ_t*)caller_handle;
+    GVJ_t *job = caller_handle;
 
     if (job->common->verbose)
        return fwrite(str, 1, len, stderr);
@@ -172,7 +172,7 @@ static cairo_pattern_t* gvloadimage_gs_load(GVJ_t * job, usershape_t *us)
 
     if (us->data) {
         if (us->datafree == gvloadimage_gs_free
-       && ((gs_t*)(us->data))->cr == (cairo_t *)job->context)
+       && ((gs_t*)(us->data))->cr == job->context)
            gs = us->data; /* use cached data */
        else {
            us->datafree(us);        /* free incompatible cache data */
@@ -185,7 +185,7 @@ static cairo_pattern_t* gvloadimage_gs_load(GVJ_t * job, usershape_t *us)
            job->common->errorfn("malloc() failure\n");
            return NULL;
        }
-       gs->cr = (cairo_t *)job->context;
+       gs->cr = job->context;
        gs->surface = NULL;
        gs->pattern = NULL;
 
@@ -205,7 +205,7 @@ static cairo_pattern_t* gvloadimage_gs_load(GVJ_t * job, usershape_t *us)
            return NULL;
        }
 
-       rc = gsapi_new_instance(&instance, (void*)job);
+       rc = gsapi_new_instance(&instance, job);
        if (rc)
            gs_error(job, us->name, "gsapi_new_instance", rc);
        else {
@@ -222,7 +222,7 @@ static cairo_pattern_t* gvloadimage_gs_load(GVJ_t * job, usershape_t *us)
 
 static void gvloadimage_gs_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_pattern_t *pattern = gvloadimage_gs_load(job, us);
 
     if (pattern) {