diff options
author | Christian Dywan <christian@imendio.com> | 2008-11-30 05:22:03 +0000 |
---|---|---|
committer | Christian Dywan <cdywan@src.gnome.org> | 2008-11-30 05:22:03 +0000 |
commit | 2dea920895860c338db6ffcf3361eb96fef08b06 (patch) | |
tree | 89371192072f90ab53d542cdb65c008f71cacb66 /gdk-pixbuf | |
parent | c8392add2249ca0ce3bcc383d84094c07646a842 (diff) | |
download | gtk+-2dea920895860c338db6ffcf3361eb96fef08b06.tar.gz |
Bug 561186 – GdkPixbuf API type checking needs cleanup
2008-11-30 Christian Dywan <christian@imendio.com>
Bug 561186 – GdkPixbuf API type checking needs cleanup
* gdk-pixbuf-loader.c (gdk_pixbuf_loader_write),
(gdk_pixbuf_loader_get_pixbuf), (gdk_pixbuf_loader_get_animation),
(gdk_pixbuf_loader_close), (gdk_pixbuf_loader_get_format):
* gdk-pixbuf-scale.c (gdk_pixbuf_scale), (gdk_pixbuf_composite),
(gdk_pixbuf_composite_color), (gdk_pixbuf_scale_simple),
(gdk_pixbuf_composite_color_simple):
* gdk-pixbuf-simple-anim.c (gdk_pixbuf_simple_anim_add_frame):
* gdk-pixbuf-util.c (gdk_pixbuf_add_alpha),
(gdk_pixbuf_apply_embedded_orientation):
Improve type checking in pixbuf API
svn path=/trunk/; revision=21832
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r-- | gdk-pixbuf/ChangeLog | 15 | ||||
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-loader.c | 5 | ||||
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-scale.c | 16 | ||||
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-simple-anim.c | 6 | ||||
-rw-r--r-- | gdk-pixbuf/gdk-pixbuf-util.c | 4 |
5 files changed, 28 insertions, 18 deletions
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index 4d88a4359e..577b267fc9 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,18 @@ +2008-11-30 Christian Dywan <christian@imendio.com> + + Bug 561186 – GdkPixbuf API type checking needs cleanup + + * gdk-pixbuf-loader.c (gdk_pixbuf_loader_write), + (gdk_pixbuf_loader_get_pixbuf), (gdk_pixbuf_loader_get_animation), + (gdk_pixbuf_loader_close), (gdk_pixbuf_loader_get_format): + * gdk-pixbuf-scale.c (gdk_pixbuf_scale), (gdk_pixbuf_composite), + (gdk_pixbuf_composite_color), (gdk_pixbuf_scale_simple), + (gdk_pixbuf_composite_color_simple): + * gdk-pixbuf-simple-anim.c (gdk_pixbuf_simple_anim_add_frame): + * gdk-pixbuf-util.c (gdk_pixbuf_add_alpha), + (gdk_pixbuf_apply_embedded_orientation): + Improve type checking in pixbuf API + 2008-10-13 Matthias Clasen <mclasen@redhat.com> Bug 555791 – Natuilus Crashes when opening USB MP3 Player Contents diff --git a/gdk-pixbuf/gdk-pixbuf-loader.c b/gdk-pixbuf/gdk-pixbuf-loader.c index 9ec8125997..f51d4478d4 100644 --- a/gdk-pixbuf/gdk-pixbuf-loader.c +++ b/gdk-pixbuf/gdk-pixbuf-loader.c @@ -446,7 +446,6 @@ gdk_pixbuf_loader_write (GdkPixbufLoader *loader, { GdkPixbufLoaderPrivate *priv; - g_return_val_if_fail (loader != NULL, FALSE); g_return_val_if_fail (GDK_IS_PIXBUF_LOADER (loader), FALSE); g_return_val_if_fail (buf != NULL, FALSE); @@ -632,7 +631,6 @@ gdk_pixbuf_loader_get_pixbuf (GdkPixbufLoader *loader) { GdkPixbufLoaderPrivate *priv; - g_return_val_if_fail (loader != NULL, NULL); g_return_val_if_fail (GDK_IS_PIXBUF_LOADER (loader), NULL); priv = loader->priv; @@ -661,7 +659,6 @@ gdk_pixbuf_loader_get_animation (GdkPixbufLoader *loader) { GdkPixbufLoaderPrivate *priv; - g_return_val_if_fail (loader != NULL, NULL); g_return_val_if_fail (GDK_IS_PIXBUF_LOADER (loader), NULL); priv = loader->priv; @@ -694,7 +691,6 @@ gdk_pixbuf_loader_close (GdkPixbufLoader *loader, GdkPixbufLoaderPrivate *priv; gboolean retval = TRUE; - g_return_val_if_fail (loader != NULL, TRUE); g_return_val_if_fail (GDK_IS_PIXBUF_LOADER (loader), TRUE); g_return_val_if_fail (error == NULL || *error == NULL, TRUE); @@ -773,7 +769,6 @@ gdk_pixbuf_loader_get_format (GdkPixbufLoader *loader) { GdkPixbufLoaderPrivate *priv; - g_return_val_if_fail (loader != NULL, NULL); g_return_val_if_fail (GDK_IS_PIXBUF_LOADER (loader), NULL); priv = loader->priv; diff --git a/gdk-pixbuf/gdk-pixbuf-scale.c b/gdk-pixbuf/gdk-pixbuf-scale.c index 4ede8d868a..694a8cb6ec 100644 --- a/gdk-pixbuf/gdk-pixbuf-scale.c +++ b/gdk-pixbuf/gdk-pixbuf-scale.c @@ -70,8 +70,8 @@ gdk_pixbuf_scale (const GdkPixbuf *src, double scale_y, GdkInterpType interp_type) { - g_return_if_fail (src != NULL); - g_return_if_fail (dest != NULL); + g_return_if_fail (GDK_IS_PIXBUF (src)); + g_return_if_fail (GDK_IS_PIXBUF (dest)); g_return_if_fail (dest_x >= 0 && dest_x + dest_width <= dest->width); g_return_if_fail (dest_y >= 0 && dest_y + dest_height <= dest->height); @@ -130,8 +130,8 @@ gdk_pixbuf_composite (const GdkPixbuf *src, GdkInterpType interp_type, int overall_alpha) { - g_return_if_fail (src != NULL); - g_return_if_fail (dest != NULL); + g_return_if_fail (GDK_IS_PIXBUF (src)); + g_return_if_fail (GDK_IS_PIXBUF (dest)); g_return_if_fail (dest_x >= 0 && dest_x + dest_width <= dest->width); g_return_if_fail (dest_y >= 0 && dest_y + dest_height <= dest->height); g_return_if_fail (overall_alpha >= 0 && overall_alpha <= 255); @@ -197,8 +197,8 @@ gdk_pixbuf_composite_color (const GdkPixbuf *src, guint32 color1, guint32 color2) { - g_return_if_fail (src != NULL); - g_return_if_fail (dest != NULL); + g_return_if_fail (GDK_IS_PIXBUF (src)); + g_return_if_fail (GDK_IS_PIXBUF (dest)); g_return_if_fail (dest_x >= 0 && dest_x + dest_width <= dest->width); g_return_if_fail (dest_y >= 0 && dest_y + dest_height <= dest->height); g_return_if_fail (overall_alpha >= 0 && overall_alpha <= 255); @@ -247,7 +247,7 @@ gdk_pixbuf_scale_simple (const GdkPixbuf *src, { GdkPixbuf *dest; - g_return_val_if_fail (src != NULL, NULL); + g_return_val_if_fail (GDK_IS_PIXBUF (src), NULL); g_return_val_if_fail (dest_width > 0, NULL); g_return_val_if_fail (dest_height > 0, NULL); @@ -293,7 +293,7 @@ gdk_pixbuf_composite_color_simple (const GdkPixbuf *src, { GdkPixbuf *dest; - g_return_val_if_fail (src != NULL, NULL); + g_return_val_if_fail (GDK_IS_PIXBUF (src), NULL); g_return_val_if_fail (dest_width > 0, NULL); g_return_val_if_fail (dest_height > 0, NULL); g_return_val_if_fail (overall_alpha >= 0 && overall_alpha <= 255, NULL); diff --git a/gdk-pixbuf/gdk-pixbuf-simple-anim.c b/gdk-pixbuf/gdk-pixbuf-simple-anim.c index 108036f9dd..3cd1560440 100644 --- a/gdk-pixbuf/gdk-pixbuf-simple-anim.c +++ b/gdk-pixbuf/gdk-pixbuf-simple-anim.c @@ -423,8 +423,8 @@ gdk_pixbuf_simple_anim_add_frame (GdkPixbufSimpleAnim *animation, GdkPixbufFrame *frame; int nframe = 0; - g_return_if_fail (animation != NULL); - g_return_if_fail (pixbuf != NULL); + g_return_if_fail (GDK_IS_PIXBUF_SIMPLE_ANIM (animation)); + g_return_if_fail (GDK_IS_PIXBUF (pixbuf)); nframe = g_list_length (animation->frames); @@ -432,7 +432,7 @@ gdk_pixbuf_simple_anim_add_frame (GdkPixbufSimpleAnim *animation, frame->delay_time = (gint) (1000 / animation->rate); frame->elapsed = (gint) (frame->delay_time * nframe); animation->total_time += frame->delay_time; - frame->pixbuf = GDK_PIXBUF (g_object_ref (pixbuf)); + frame->pixbuf = g_object_ref (pixbuf); animation->frames = g_list_append (animation->frames, frame); } diff --git a/gdk-pixbuf/gdk-pixbuf-util.c b/gdk-pixbuf/gdk-pixbuf-util.c index f682aec9ba..6e8f09eac3 100644 --- a/gdk-pixbuf/gdk-pixbuf-util.c +++ b/gdk-pixbuf/gdk-pixbuf-util.c @@ -55,7 +55,7 @@ gdk_pixbuf_add_alpha (const GdkPixbuf *pixbuf, GdkPixbuf *new_pixbuf; int x, y; - g_return_val_if_fail (pixbuf != NULL, NULL); + g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL); g_return_val_if_fail (pixbuf->colorspace == GDK_COLORSPACE_RGB, NULL); g_return_val_if_fail (pixbuf->n_channels == 3 || pixbuf->n_channels == 4, NULL); g_return_val_if_fail (pixbuf->bits_per_sample == 8, NULL); @@ -277,7 +277,7 @@ gdk_pixbuf_apply_embedded_orientation (GdkPixbuf *src) GdkPixbuf *temp; GdkPixbuf *dest; - g_return_val_if_fail (src != NULL, NULL); + g_return_val_if_fail (GDK_IS_PIXBUF (src), NULL); /* Read the orientation option associated with the pixbuf */ orientation_string = gdk_pixbuf_get_option (src, "orientation"); |