diff options
author | Sven Herzberg <sven@imendio.com> | 2008-08-08 15:30:22 +0000 |
---|---|---|
committer | Sven Herzberg <herzi@src.gnome.org> | 2008-08-08 15:30:22 +0000 |
commit | 1c60b85915c40ce7f1fbe4cf1318d7f7c8b0f6cb (patch) | |
tree | 7fc5b0cec39fd56b2ec9d996d5cfaed32efb6666 /gdk-pixbuf | |
parent | 1b34902d33768b5f92fc00947b92225ed2ff73f2 (diff) | |
download | gtk+-1c60b85915c40ce7f1fbe4cf1318d7f7c8b0f6cb.tar.gz |
Bug 546549 : Better Type Checking reviewed by: mitch
2008-08-08 Sven Herzberg <sven@imendio.com>
Bug 546549 : Better Type Checking
reviewed by: mitch
* gdk-pixbuf-animation.c: check if a vfunc is implemented before
trying to call into it
svn path=/trunk/; revision=21047
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r-- | gdk-pixbuf/ChangeLog | 8 | ||||
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-animation.c | 20 |
2 files changed, 20 insertions, 8 deletions
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index b965396b3f..12135ba1a0 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,11 @@ +2008-08-08 Sven Herzberg <sven@imendio.com> + + Bug 546549 : Better Type Checking + reviewed by: mitch + + * gdk-pixbuf-animation.c: check if a vfunc is implemented before + trying to call into it + 2008-08-06 Sven Herzberg <sven@imendio.com> Bug 546549 : Better Type Checking diff --git a/gdk-pixbuf/gdk-pixbuf-animation.c b/gdk-pixbuf/gdk-pixbuf-animation.c index 8431aa8e48..290630ef0c 100644 --- a/gdk-pixbuf/gdk-pixbuf-animation.c +++ b/gdk-pixbuf/gdk-pixbuf-animation.c @@ -447,7 +447,7 @@ gdk_pixbuf_animation_iter_init (GdkPixbufAnimationIter *iter) /** * gdk_pixbuf_animation_iter_get_delay_time: * @iter: an animation iterator - * + * * Gets the number of milliseconds the current pixbuf should be displayed, * or -1 if the current pixbuf should be displayed forever. g_timeout_add() * conveniently takes a timeout in milliseconds, so you can use a timeout @@ -459,7 +459,8 @@ int gdk_pixbuf_animation_iter_get_delay_time (GdkPixbufAnimationIter *iter) { g_return_val_if_fail (GDK_IS_PIXBUF_ANIMATION_ITER (iter), -1); - + g_return_val_if_fail (GDK_PIXBUF_ANIMATION_ITER_GET_CLASS (iter)->get_delay_time, -1); + return GDK_PIXBUF_ANIMATION_ITER_GET_CLASS (iter)->get_delay_time (iter); } @@ -485,7 +486,8 @@ GdkPixbuf* gdk_pixbuf_animation_iter_get_pixbuf (GdkPixbufAnimationIter *iter) { g_return_val_if_fail (GDK_IS_PIXBUF_ANIMATION_ITER (iter), NULL); - + g_return_val_if_fail (GDK_PIXBUF_ANIMATION_ITER_GET_CLASS (iter)->get_pixbuf, NULL); + return GDK_PIXBUF_ANIMATION_ITER_GET_CLASS (iter)->get_pixbuf (iter); } @@ -498,14 +500,15 @@ gdk_pixbuf_animation_iter_get_pixbuf (GdkPixbufAnimationIter *iter) * for an area of the frame currently streaming in to the loader. So if * you're on the currently loading frame, you need to redraw the screen for * the updated area. - * + * * Return value: %TRUE if the frame we're on is partially loaded, or the last frame **/ gboolean gdk_pixbuf_animation_iter_on_currently_loading_frame (GdkPixbufAnimationIter *iter) { g_return_val_if_fail (GDK_IS_PIXBUF_ANIMATION_ITER (iter), FALSE); - + g_return_val_if_fail (GDK_PIXBUF_ANIMATION_ITER_GET_CLASS (iter)->on_currently_loading_frame, FALSE); + return GDK_PIXBUF_ANIMATION_ITER_GET_CLASS (iter)->on_currently_loading_frame (iter); } @@ -516,7 +519,7 @@ gdk_pixbuf_animation_iter_on_currently_loading_frame (GdkPixbufAnimationIter *it * * Possibly advances an animation to a new frame. Chooses the frame based * on the start time passed to gdk_pixbuf_animation_get_iter(). - * + * * @current_time would normally come from g_get_current_time(), and * must be greater than or equal to the time passed to * gdk_pixbuf_animation_get_iter(), and must increase or remain @@ -542,14 +545,15 @@ gdk_pixbuf_animation_iter_advance (GdkPixbufAnimationIter *iter, const GTimeVal *current_time) { GTimeVal val; - + g_return_val_if_fail (GDK_IS_PIXBUF_ANIMATION_ITER (iter), FALSE); + g_return_val_if_fail (GDK_PIXBUF_ANIMATION_ITER_GET_CLASS (iter)->advance, FALSE); if (current_time) val = *current_time; else g_get_current_time (&val); - + return GDK_PIXBUF_ANIMATION_ITER_GET_CLASS (iter)->advance (iter, &val); } |