From 15d434294dd60c43fe9b9eec8a218db6b6e15ee8 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Wed, 3 Aug 2016 07:41:44 -0300 Subject: [PATCH] eeshow/cro.h (cro_img_end, cro_img_write, cro_canvas_end): don't need void * Since we don't call these functions through gfx_ops, we don't need a void pointer. --- eeshow/cro.c | 10 +++------- eeshow/cro.h | 6 +++--- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/eeshow/cro.c b/eeshow/cro.c index 2fb2f4f..4b7f66a 100644 --- a/eeshow/cro.c +++ b/eeshow/cro.c @@ -415,9 +415,8 @@ static void cr_pdf_end(void *ctx) } -uint32_t *cro_img_end(void *ctx, int *w, int *h, int *stride) +uint32_t *cro_img_end(struct cro_ctx *cc, int *w, int *h, int *stride) { - struct cro_ctx *cc = ctx; uint32_t *data; end_common(cc, w, h); @@ -444,10 +443,8 @@ uint32_t *cro_img_end(void *ctx, int *w, int *h, int *stride) } -void cro_img_write(void *ctx, const char *name) +void cro_img_write(struct cro_ctx *cc, const char *name) { - struct cro_ctx *cc = ctx; - if (name) cairo_surface_write_to_png(cc->s, name); else @@ -456,9 +453,8 @@ void cro_img_write(void *ctx, const char *name) } -void cro_canvas_end(void *ctx) +void cro_canvas_end(struct cro_ctx *cc) { - struct cro_ctx *cc = ctx; int w, h; end_common(cc, &w, &h); diff --git a/eeshow/cro.h b/eeshow/cro.h index ae4dc8c..a050ad8 100644 --- a/eeshow/cro.h +++ b/eeshow/cro.h @@ -31,10 +31,10 @@ extern const struct gfx_ops cro_pdf_ops; #define cro_canvas_ops cro_png_ops /* just don't call cro_canvas_ops.end */ -uint32_t *cro_img_end(void *ctx, int *w, int *h, int *stride); -void cro_img_write(void *ctx, const char *name); +uint32_t *cro_img_end(struct cro_ctx *cc, int *w, int *h, int *stride); +void cro_img_write(struct cro_ctx *cc, const char *name); -void cro_canvas_end(void *ctx); +void cro_canvas_end(struct cro_ctx *cc); void cro_canvas_draw(struct cro_ctx *cc, cairo_t *cr); #endif /* !CRO_H */