From 83f9e707eba500d39c12b8078948b932706cdab2 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 9 May 2011 15:32:34 +0000 Subject: refactor content handler initilisation to use named initialisors svn path=/trunk/netsurf/; revision=12341 --- image/bmp.c | 22 +++++++--------------- image/gif.c | 22 +++++++--------------- image/ico.c | 22 +++++++--------------- image/jpeg.c | 22 +++++++--------------- image/mng.c | 23 ++++++++--------------- image/nssprite.c | 22 +++++++--------------- image/png.c | 23 ++++++++--------------- image/rsvg.c | 23 ++++++++--------------- image/svg.c | 23 ++++++++--------------- image/webp.c | 22 +++++++--------------- 10 files changed, 74 insertions(+), 150 deletions(-) (limited to 'image') diff --git a/image/bmp.c b/image/bmp.c index 9e1326e62..b40ab7e8c 100644 --- a/image/bmp.c +++ b/image/bmp.c @@ -272,21 +272,13 @@ static content_type nsbmp_content_type(lwc_string *mime_type) static const content_handler nsbmp_content_handler = { - nsbmp_create, - NULL, - nsbmp_convert, - NULL, - nsbmp_destroy, - NULL, - NULL, - NULL, - nsbmp_redraw, - NULL, - NULL, - nsbmp_clone, - NULL, - nsbmp_content_type, - false + .create = nsbmp_create, + .data_complete = nsbmp_convert, + .destroy = nsbmp_destroy, + .redraw = nsbmp_redraw, + .clone = nsbmp_clone, + .type = nsbmp_content_type, + .no_share = false, }; nserror nsbmp_init(void) diff --git a/image/gif.c b/image/gif.c index 5812952c1..696362205 100644 --- a/image/gif.c +++ b/image/gif.c @@ -418,21 +418,13 @@ static content_type nsgif_content_type(lwc_string *mime_type) static const content_handler nsgif_content_handler = { - nsgif_create, - NULL, - nsgif_convert, - NULL, - nsgif_destroy, - NULL, - NULL, - NULL, - nsgif_redraw, - NULL, - NULL, - nsgif_clone, - NULL, - nsgif_content_type, - false + .create = nsgif_create, + .data_complete = nsgif_convert, + .destroy = nsgif_destroy, + .redraw = nsgif_redraw, + .clone = nsgif_clone, + .type = nsgif_content_type, + .no_share = false, }; nserror nsgif_init(void) diff --git a/image/ico.c b/image/ico.c index 2f546b6e8..e9cfc3a55 100644 --- a/image/ico.c +++ b/image/ico.c @@ -230,21 +230,13 @@ static content_type nsico_content_type(lwc_string *mime_type) } static const content_handler nsico_content_handler = { - nsico_create, - NULL, - nsico_convert, - NULL, - nsico_destroy, - NULL, - NULL, - NULL, - nsico_redraw, - NULL, - NULL, - nsico_clone, - NULL, - nsico_content_type, - false + .create = nsico_create, + .data_complete = nsico_convert, + .destroy = nsico_destroy, + .redraw = nsico_redraw, + .clone = nsico_clone, + .type = nsico_content_type, + .no_share = false, }; diff --git a/image/jpeg.c b/image/jpeg.c index 1d0e16edd..5b355f3e5 100644 --- a/image/jpeg.c +++ b/image/jpeg.c @@ -335,21 +335,13 @@ static content_type nsjpeg_content_type(lwc_string *mime_type) } static const content_handler nsjpeg_content_handler = { - nsjpeg_create, - NULL, - nsjpeg_convert, - NULL, - nsjpeg_destroy, - NULL, - NULL, - NULL, - nsjpeg_redraw, - NULL, - NULL, - nsjpeg_clone, - NULL, - nsjpeg_content_type, - false + .create = nsjpeg_create, + .data_complete = nsjpeg_convert, + .destroy = nsjpeg_destroy, + .redraw = nsjpeg_redraw, + .clone = nsjpeg_clone, + .type = nsjpeg_content_type, + .no_share = false, }; nserror nsjpeg_init(void) diff --git a/image/mng.c b/image/mng.c index 21e5d9d38..ee2b121ea 100644 --- a/image/mng.c +++ b/image/mng.c @@ -96,21 +96,14 @@ static void nsmng_free(mng_ptr p, mng_size_t n); #endif static const content_handler nsmng_content_handler = { - nsmng_create, - nsmng_process_data, - nsmng_convert, - NULL, - nsmng_destroy, - NULL, - NULL, - NULL, - nsmng_redraw, - NULL, - NULL, - nsmng_clone, - NULL, - nsmng_content_type, - false + .create = nsmng_create, + .process_data = nsmng_process_data, + .data_complete = nsmng_convert, + .destroy = nsmng_destroy, + .redraw = nsmng_redraw, + .clone = nsmng_clone, + .type = nsmng_content_type, + .no_share = false, }; static const char *jng_types[] = { diff --git a/image/nssprite.c b/image/nssprite.c index 670764ab7..4c1e173c0 100644 --- a/image/nssprite.c +++ b/image/nssprite.c @@ -72,21 +72,13 @@ static content_type nssprite_content_type(lwc_string *mime_type); } while(0) static const content_handler nssprite_content_handler = { - nssprite_create, - NULL, - nssprite_convert, - NULL, - nssprite_destroy, - NULL, - NULL, - NULL, - nssprite_redraw, - NULL, - NULL, - nssprite_clone, - NULL, - nssprite_content_type, - false + .create = nssprite_create, + .data_complete = nssprite_convert, + .destroy = nssprite_destroy, + .redraw = nssprite_redraw, + .clone = nssprite_clone, + .type = nssprite_content_type, + .no_share = false, }; static const char *nssprite_types[] = { diff --git a/image/png.c b/image/png.c index f3fbf35ea..3093c89e8 100644 --- a/image/png.c +++ b/image/png.c @@ -413,21 +413,14 @@ static content_type nspng_content_type(lwc_string *mime_type) } static const content_handler nspng_content_handler = { - nspng_create, - nspng_process_data, - nspng_convert, - NULL, - nspng_destroy, - NULL, - NULL, - NULL, - nspng_redraw, - NULL, - NULL, - nspng_clone, - NULL, - nspng_content_type, - false + .create = nspng_create, + .process_data = nspng_process_data, + .data_complete = nspng_convert, + .destroy = nspng_destroy, + .redraw = nspng_redraw, + .clone = nspng_clone, + .type = nspng_content_type, + .no_share = false, }; nserror nspng_init(void) diff --git a/image/rsvg.c b/image/rsvg.c index 80c5368a4..63c2f2b6f 100644 --- a/image/rsvg.c +++ b/image/rsvg.c @@ -310,21 +310,14 @@ static content_type rsvg_content_type(lwc_string *mime_type) } static const content_handler rsvg_content_handler = { - rsvg_create, - rsvg_process_data, - rsvg_convert, - NULL, - rsvg_destroy, - NULL, - NULL, - NULL, - rsvg_redraw, - NULL, - NULL, - rsvg_clone, - NULL, - rsvg_content_type, - false + .create = rsvg_create, + .process_data = rsvg_process_data, + .data_complete = rsvg_convert, + .destroy = rsvg_destroy, + .redraw = rsvg_redraw, + .clone = rsvg_clone, + .type = rsvg_content_type, + .no_share = false, }; nserror nsrsvg_init(void) diff --git a/image/svg.c b/image/svg.c index 5f093b8e8..a447eaf54 100644 --- a/image/svg.c +++ b/image/svg.c @@ -59,21 +59,14 @@ static nserror svg_clone(const struct content *old, struct content **newc); static content_type svg_content_type(lwc_string *mime_type); static const content_handler svg_content_handler = { - svg_create, - NULL, - svg_convert, - svg_reformat, - svg_destroy, - NULL, - NULL, - NULL, - svg_redraw, - NULL, - NULL, - svg_clone, - NULL, - svg_content_type, - false + .create = svg_create, + .data_complete = svg_convert, + .reformat = svg_reformat, + .destroy = svg_destroy, + .redraw = svg_redraw, + .clone = svg_clone, + .type = svg_content_type, + .no_share = false, }; static const char *svg_types[] = { diff --git a/image/webp.c b/image/webp.c index 7b651a1c7..daa7f4522 100644 --- a/image/webp.c +++ b/image/webp.c @@ -55,21 +55,13 @@ static nserror webp_clone(const struct content *old, struct content **newc); static content_type webp_content_type(lwc_string *mime_type); static const content_handler webp_content_handler = { - webp_create, - NULL, - webp_convert, - NULL, - webp_destroy, - NULL, - NULL, - NULL, - webp_redraw, - NULL, - NULL, - webp_clone, - NULL, - webp_content_type, - false + .create = webp_create, + .data_complete = webp_convert, + .destroy = webp_destroy, + .redraw = webp_redraw, + .clone = webp_clone, + .type = webp_content_type, + .no_share = false, }; static const char *webp_types[] = { -- cgit v1.2.3