From: Matthew Fernandez Date: Thu, 31 Mar 2022 03:42:14 +0000 (-0700) Subject: WebP plugin: remove unnecessary parens X-Git-Tag: 4.0.0~146^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d64fe223241b32a69b0a8e61b3474374d17518c7;p=graphviz WebP plugin: remove unnecessary parens --- diff --git a/plugin/webp/gvdevice_webp.c b/plugin/webp/gvdevice_webp.c index 6bded0c76..5ee9a5a57 100644 --- a/plugin/webp/gvdevice_webp.c +++ b/plugin/webp/gvdevice_webp.c @@ -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(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) diff --git a/plugin/webp/gvloadimage_webp.c b/plugin/webp/gvloadimage_webp.c index ba032a135..ad96f7e91 100644 --- a/plugin/webp/gvloadimage_webp.c +++ b/plugin/webp/gvloadimage_webp.c @@ -71,7 +71,7 @@ static cairo_surface_t* webp_really_loadimage(const char *in_file, FILE* const i size_t data_size = (size_t)size; fseek(in, 0, SEEK_SET); data = malloc(data_size); - ok = (fread(data, data_size, 1, in) == 1); + ok = fread(data, data_size, 1, in) == 1; if (!ok) { fprintf(stderr, "Error: WebP could not read %zu bytes of data from %s\n", data_size, in_file); @@ -93,7 +93,7 @@ static cairo_surface_t* webp_really_loadimage(const char *in_file, FILE* const i unsigned char *p, t; for (y = 0; y < output_buffer->height; y++) { - p = output_buffer->u.RGBA.rgba + (output_buffer->u.RGBA.stride * y); + p = output_buffer->u.RGBA.rgba + output_buffer->u.RGBA.stride * y; for (x = 0; x < output_buffer->width; x++) { t = p[0]; /* swap red/blue */ p[0] = p[2]; @@ -105,7 +105,7 @@ static cairo_surface_t* webp_really_loadimage(const char *in_file, FILE* const i end: free(data); - ok = (status == VP8_STATUS_OK); + ok = status == VP8_STATUS_OK; if (!ok) { fprintf(stderr, "Error: WebP decoding of %s failed.\n", in_file); fprintf(stderr, "Status: %d (%s)\n", status, kStatusMessages[status]); @@ -172,7 +172,7 @@ static void webp_loadimage_cairo(GVJ_t * job, usershape_t *us, boxf b, bool fill if (surface) { cairo_save(cr); cairo_translate(cr, b.LL.x, -b.UR.y); - cairo_scale(cr, (b.UR.x - b.LL.x)/(us->w), (b.UR.y - b.LL.y)/(us->h)); + cairo_scale(cr, (b.UR.x - b.LL.x) / us->w, (b.UR.y - b.LL.y) / us->h); cairo_set_source_surface (cr, surface, 0, 0); cairo_paint (cr); cairo_restore(cr);