gtk+ r21025 - trunk/gdk-pixbuf
- From: herzi svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk+ r21025 - trunk/gdk-pixbuf
- Date: Wed, 6 Aug 2008 16:15:32 +0000 (UTC)
Author: herzi
Date: Wed Aug 6 16:15:31 2008
New Revision: 21025
URL: http://svn.gnome.org/viewvc/gtk+?rev=21025&view=rev
Log:
2008-08-06 Sven Herzberg <sven imendio com>
Bug 546549 : Better Type Checking
reviewed by mitch
* gdk-pixbuf.c (gdk_pixbuf_copy), (gdk_pixbuf_get_colorspace),
(gdk_pixbuf_get_n_channels), (gdk_pixbuf_get_has_alpha),
(gdk_pixbuf_get_bits_per_sample), (gdk_pixbuf_get_pixels),
(gdk_pixbuf_get_width), (gdk_pixbuf_get_height),
(gdk_pixbuf_get_rowstride): use GDK_IS_PIXBUF() and not pixbuf != NULL
in g_return_*() statements
Modified:
trunk/gdk-pixbuf/ChangeLog
trunk/gdk-pixbuf/gdk-pixbuf.c
Modified: trunk/gdk-pixbuf/gdk-pixbuf.c
==============================================================================
--- trunk/gdk-pixbuf/gdk-pixbuf.c (original)
+++ trunk/gdk-pixbuf/gdk-pixbuf.c Wed Aug 6 16:15:31 2008
@@ -291,7 +291,7 @@
guchar *buf;
int size;
- g_return_val_if_fail (pixbuf != NULL, NULL);
+ g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
/* Calculate a semi-exact size. Here we copy with full rowstrides;
* maybe we should copy each row individually with the minimum
@@ -385,7 +385,7 @@
GdkColorspace
gdk_pixbuf_get_colorspace (const GdkPixbuf *pixbuf)
{
- g_return_val_if_fail (pixbuf != NULL, GDK_COLORSPACE_RGB);
+ g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), GDK_COLORSPACE_RGB);
return pixbuf->colorspace;
}
@@ -401,7 +401,7 @@
int
gdk_pixbuf_get_n_channels (const GdkPixbuf *pixbuf)
{
- g_return_val_if_fail (pixbuf != NULL, -1);
+ g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), -1);
return pixbuf->n_channels;
}
@@ -417,7 +417,7 @@
gboolean
gdk_pixbuf_get_has_alpha (const GdkPixbuf *pixbuf)
{
- g_return_val_if_fail (pixbuf != NULL, FALSE);
+ g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), FALSE);
return pixbuf->has_alpha ? TRUE : FALSE;
}
@@ -433,7 +433,7 @@
int
gdk_pixbuf_get_bits_per_sample (const GdkPixbuf *pixbuf)
{
- g_return_val_if_fail (pixbuf != NULL, -1);
+ g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), -1);
return pixbuf->bits_per_sample;
}
@@ -451,7 +451,7 @@
guchar *
gdk_pixbuf_get_pixels (const GdkPixbuf *pixbuf)
{
- g_return_val_if_fail (pixbuf != NULL, NULL);
+ g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
return pixbuf->pixels;
}
@@ -467,7 +467,7 @@
int
gdk_pixbuf_get_width (const GdkPixbuf *pixbuf)
{
- g_return_val_if_fail (pixbuf != NULL, -1);
+ g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), -1);
return pixbuf->width;
}
@@ -483,7 +483,7 @@
int
gdk_pixbuf_get_height (const GdkPixbuf *pixbuf)
{
- g_return_val_if_fail (pixbuf != NULL, -1);
+ g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), -1);
return pixbuf->height;
}
@@ -500,7 +500,7 @@
int
gdk_pixbuf_get_rowstride (const GdkPixbuf *pixbuf)
{
- g_return_val_if_fail (pixbuf != NULL, -1);
+ g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), -1);
return pixbuf->rowstride;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]