gtk+ r21832 - trunk/gdk-pixbuf
- From: cdywan svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r21832 - trunk/gdk-pixbuf
- Date: Sun, 30 Nov 2008 05:22:03 +0000 (UTC)
Author: cdywan
Date: Sun Nov 30 05:22:03 2008
New Revision: 21832
URL: http://svn.gnome.org/viewvc/gtk+?rev=21832&view=rev
Log:
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
Modified:
trunk/gdk-pixbuf/ChangeLog
trunk/gdk-pixbuf/gdk-pixbuf-loader.c
trunk/gdk-pixbuf/gdk-pixbuf-scale.c
trunk/gdk-pixbuf/gdk-pixbuf-simple-anim.c
trunk/gdk-pixbuf/gdk-pixbuf-util.c
Modified: trunk/gdk-pixbuf/gdk-pixbuf-loader.c
==============================================================================
--- trunk/gdk-pixbuf/gdk-pixbuf-loader.c (original)
+++ trunk/gdk-pixbuf/gdk-pixbuf-loader.c Sun Nov 30 05:22:03 2008
@@ -446,7 +446,6 @@
{
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 @@
{
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 @@
{
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 @@
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 @@
{
GdkPixbufLoaderPrivate *priv;
- g_return_val_if_fail (loader != NULL, NULL);
g_return_val_if_fail (GDK_IS_PIXBUF_LOADER (loader), NULL);
priv = loader->priv;
Modified: trunk/gdk-pixbuf/gdk-pixbuf-scale.c
==============================================================================
--- trunk/gdk-pixbuf/gdk-pixbuf-scale.c (original)
+++ trunk/gdk-pixbuf/gdk-pixbuf-scale.c Sun Nov 30 05:22:03 2008
@@ -70,8 +70,8 @@
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 @@
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 @@
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 @@
{
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 @@
{
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);
Modified: trunk/gdk-pixbuf/gdk-pixbuf-simple-anim.c
==============================================================================
--- trunk/gdk-pixbuf/gdk-pixbuf-simple-anim.c (original)
+++ trunk/gdk-pixbuf/gdk-pixbuf-simple-anim.c Sun Nov 30 05:22:03 2008
@@ -423,8 +423,8 @@
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 @@
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);
}
Modified: trunk/gdk-pixbuf/gdk-pixbuf-util.c
==============================================================================
--- trunk/gdk-pixbuf/gdk-pixbuf-util.c (original)
+++ trunk/gdk-pixbuf/gdk-pixbuf-util.c Sun Nov 30 05:22:03 2008
@@ -55,7 +55,7 @@
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 @@
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");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]