summaryrefslogtreecommitdiff
path: root/gdk-pixbuf
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@gnome.org>2017-11-29 06:57:35 -0600
committerEmmanuele Bassi <ebassi@gmail.com>2020-01-07 14:23:05 +0000
commite8fe9ff11c9c80cd874ceb21461e6e2fa34321bb (patch)
tree639b9207c791c6190b6d5d7042e4ddca70375a44 /gdk-pixbuf
parent61188355401795e10f9a47e12519af1a87b82bcc (diff)
downloadgdk-pixbuf-e8fe9ff11c9c80cd874ceb21461e6e2fa34321bb.tar.gz
gdip-utils: assert and assume that the module callbacks are non-NULL
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r--gdk-pixbuf/io-gdip-utils.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/gdk-pixbuf/io-gdip-utils.c b/gdk-pixbuf/io-gdip-utils.c
index 30028ff59..eccd02455 100644
--- a/gdk-pixbuf/io-gdip-utils.c
+++ b/gdk-pixbuf/io-gdip-utils.c
@@ -551,19 +551,17 @@ destroy_gdipcontext (GdipContext *context)
static void
emit_updated (GdipContext *context, GdkPixbuf *pixbuf)
{
- if (context->updated_func)
- (*context->updated_func) (pixbuf,
- 0, 0,
- gdk_pixbuf_get_width (pixbuf),
- gdk_pixbuf_get_height (pixbuf),
- context->user_data);
+ (*context->updated_func) (pixbuf,
+ 0, 0,
+ gdk_pixbuf_get_width (pixbuf),
+ gdk_pixbuf_get_height (pixbuf),
+ context->user_data);
}
static void
emit_prepared (GdipContext *context, GdkPixbuf *pixbuf, GdkPixbufAnimation *anim)
{
- if (context->prepared_func)
- (*context->prepared_func) (pixbuf, anim, context->user_data);
+ (*context->prepared_func) (pixbuf, anim, context->user_data);
}
static gpointer
@@ -575,6 +573,10 @@ gdk_pixbuf__gdip_image_begin_load (GdkPixbufModuleSizeFunc size_func,
{
GdipContext *context = g_new0 (GdipContext, 1);
+ g_assert (size_func != NULL);
+ g_assert (prepared_func != NULL);
+ g_assert (updated_func != NULL);
+
context->size_func = size_func;
context->prepared_func = prepared_func;
context->updated_func = updated_func;