summaryrefslogtreecommitdiff
path: root/gdk-pixbuf
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@gnome.org>2017-11-28 19:16:36 -0600
committerEmmanuele Bassi <ebassi@gmail.com>2020-01-07 14:23:05 +0000
commitcfb2f43e9f8e89004fd9cb5a581357ce3eb79a7b (patch)
treef4dd7f2f35715590fbb71227bf93ff8d868f6c66 /gdk-pixbuf
parent2cb97be60792fc50dc636575fce1a7ae46865f79 (diff)
downloadgdk-pixbuf-cfb2f43e9f8e89004fd9cb5a581357ce3eb79a7b.tar.gz
ICNS: assert and assume that the module callbacks are non-NULL
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r--gdk-pixbuf/io-icns.c35
1 files changed, 18 insertions, 17 deletions
diff --git a/gdk-pixbuf/io-icns.c b/gdk-pixbuf/io-icns.c
index b832c761c..bee669b8b 100644
--- a/gdk-pixbuf/io-icns.c
+++ b/gdk-pixbuf/io-icns.c
@@ -399,6 +399,10 @@ gdk_pixbuf__icns_image_begin_load (GdkPixbufModuleSizeFunc size_func,
{
IcnsProgressiveState *context;
+ g_assert (size_func != NULL);
+ g_assert (prepared_func != NULL);
+ g_assert (updated_func != NULL);
+
context = g_new0 (IcnsProgressiveState, 1);
context->size_func = size_func;
context->prepared_func = prepared_func;
@@ -461,23 +465,20 @@ gdk_pixbuf__icns_image_load_increment (gpointer data,
w = gdk_pixbuf_get_width (context->pixbuf);
h = gdk_pixbuf_get_height (context->pixbuf);
- if (context->size_func != NULL)
- (*context->size_func) (&w,
- &h,
- context->user_data);
-
- if (context->prepared_func != NULL)
- (*context->prepared_func) (context->pixbuf,
- NULL,
- context->user_data);
-
- if (context->updated_func != NULL)
- (*context->updated_func) (context->pixbuf,
- 0,
- 0,
- gdk_pixbuf_get_width (context->pixbuf),
- gdk_pixbuf_get_height (context->pixbuf),
- context->user_data);
+ (*context->size_func) (&w,
+ &h,
+ context->user_data);
+
+ (*context->prepared_func) (context->pixbuf,
+ NULL,
+ context->user_data);
+
+ (*context->updated_func) (context->pixbuf,
+ 0,
+ 0,
+ gdk_pixbuf_get_width (context->pixbuf),
+ gdk_pixbuf_get_height (context->pixbuf),
+ context->user_data);
return TRUE;
}