Commit ad55aef2 authored by Sven Neumann's avatar Sven Neumann
Browse files

gimp_drawable_get_color_at() now silently returns NULL again if the

* app/gimpdrawable.c: gimp_drawable_get_color_at() now silently
returns NULL again if the coordinates are out of range. A lot of
code using this function relies on this feature and correctly
checks the return value. No need to emit critical warnings here.

The GTK_CHECK_TYPE macro test for obj != NULL, no need to do this
check twice. Removed lots of unnecessary calls to g_return_if_fail().

* app/color_picker.c: with the old behaviour of
gimp_drawable_get_color_at() the code is a bit simpler.

* app/fuzzy_select.c: fuzzy_select relied on drawable_offsets()
returning off_x = off_y = 0 if drawable == NULL. Decided to change
this here, fixes bug #7077.

* app/gimpimage.[ch]: Even though we made bad experiences with the
changes in gimpdrawable.c, I have introduced similar argument checks
here.

* app/image_map.c: indentation


--Sven
parent ccfca2e1
Thu Mar 9 12:44:55 CET 2000 Sven Neumann <sven@gimp.org>
* app/gimpdrawable.c: gimp_drawable_get_color_at() now silently
returns NULL again if the coordinates are out of range. A lot of
code using this function relies on this feature and correctly
checks the return value. No need to emit critical warnings here.
The GTK_CHECK_TYPE macro test for obj != NULL, no need to do this
check twice. Removed lots of unnecessary calls to g_return_if_fail().
* app/color_picker.c: with the old behaviour of
gimp_drawable_get_color_at() the code is a bit simpler.
* app/fuzzy_select.c: fuzzy_select relied on drawable_offsets()
returning off_x = off_y = 0 if drawable == NULL. Decided to change
this here, fixes bug #7077.
* app/gimpimage.[ch]: Even though we made bad experiences with the
changes in gimpdrawable.c, I have introduced similar argument checks
here.
* app/image_map.c: indentation
Wed Mar 8 23:37:38 CET 2000 Sven Neumann <sven@gimp.org>
 
* app/menus.c: Oops, my last commit broke LANG=C. This is now fixed.
......
......@@ -504,16 +504,9 @@ pick_color_do (GimpImage *gimage,
has_alpha = TYPE_HAS_ALPHA (sample_type);
if( x >= 0 && x < gimp_drawable_width (drawable) &&
y >= 0 && y < gimp_drawable_height (drawable))
{
if (!(color = (*get_color_func) (get_color_obj, x, y)))
return FALSE;
}
else
{
return FALSE;
}
if (!(color = (*get_color_func) (get_color_obj, x, y)))
return FALSE;
if (sample_average)
{
gint i, j;
......@@ -527,16 +520,16 @@ pick_color_do (GimpImage *gimage,
if ((tmp_color = (*get_color_func) (get_color_obj, i, j)))
{
count++;
color_avg[RED_PIX] += tmp_color[RED_PIX];
color_avg[GREEN_PIX] += tmp_color[GREEN_PIX];
color_avg[BLUE_PIX] += tmp_color[BLUE_PIX];
if (has_alpha)
color_avg[ALPHA_PIX] += tmp_color[3];
g_free (tmp_color);
}
color[RED_PIX] = (guchar) (color_avg[RED_PIX] / count);
color[GREEN_PIX] = (guchar) (color_avg[GREEN_PIX] / count);
color[BLUE_PIX] = (guchar) (color_avg[BLUE_PIX] / count);
......
......@@ -63,7 +63,7 @@ gimp_drawable_class_init (GimpDrawableClass *class)
GtkObjectClass *object_class;
GtkType type = GIMP_TYPE_DRAWABLE;
object_class = GTK_OBJECT_CLASS(class);
object_class = GTK_OBJECT_CLASS (class);
parent_class = gtk_type_class (GIMP_TYPE_OBJECT);
gimp_drawable_signals[INVALIDATE_PREVIEW] =
......@@ -105,7 +105,6 @@ gimp_drawable_merge_shadow (GimpDrawable *drawable,
PixelRegion shadowPR;
int x1, y1, x2, y2;
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
gimage = gimp_drawable_gimage (drawable);
......@@ -135,7 +134,6 @@ gimp_drawable_fill (GimpDrawable *drawable,
guchar c[MAX_CHANNELS];
guchar i;
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
gimage = gimp_drawable_gimage (drawable);
......@@ -189,7 +187,6 @@ gimp_drawable_mask_bounds (GimpDrawable *drawable,
GimpImage *gimage;
gint off_x, off_y;
g_return_val_if_fail (drawable != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
gimage = gimp_drawable_gimage (drawable);
......@@ -217,7 +214,6 @@ gimp_drawable_invalidate_preview (GimpDrawable *drawable)
{
GimpImage *gimage;
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
drawable->preview_valid = FALSE;
......@@ -238,7 +234,6 @@ gimp_drawable_invalidate_preview (GimpDrawable *drawable)
GimpImage *
gimp_drawable_gimage (GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
return drawable->gimage;
......@@ -248,7 +243,6 @@ void
gimp_drawable_set_gimage (GimpDrawable *drawable,
GimpImage *gimage)
{
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
if (gimage == NULL)
......@@ -262,7 +256,6 @@ gimp_drawable_set_gimage (GimpDrawable *drawable,
gboolean
gimp_drawable_has_alpha (GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
return drawable->has_alpha;
......@@ -271,7 +264,6 @@ gimp_drawable_has_alpha (GimpDrawable *drawable)
GimpImageType
gimp_drawable_type (GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, -1);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), -1);
return drawable->type;
......@@ -283,7 +275,6 @@ gimp_drawable_type_with_alpha (GimpDrawable *drawable)
GimpImageType type;
gboolean has_alpha;
g_return_val_if_fail (drawable != NULL, -1);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), -1);
type = gimp_drawable_type (drawable);
......@@ -310,7 +301,6 @@ gimp_drawable_type_with_alpha (GimpDrawable *drawable)
gboolean
gimp_drawable_visible (GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
return drawable->visible;
......@@ -319,7 +309,6 @@ gimp_drawable_visible (GimpDrawable *drawable)
gchar *
gimp_drawable_get_name (GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
return drawable->name;
......@@ -336,7 +325,6 @@ gimp_drawable_set_name (GimpDrawable *drawable,
gchar *ext;
gchar numberbuf[20];
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (name != NULL);
......@@ -422,12 +410,13 @@ gimp_drawable_get_color_at (GimpDrawable *drawable,
guchar *src;
guchar *dest;
g_return_val_if_fail (drawable != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
g_return_val_if_fail (gimp_drawable_gimage (drawable) ||
!gimp_drawable_is_indexed (drawable), NULL);
g_return_val_if_fail (x >= 0 && x < drawable->width &&
y >= 0 && y < drawable->height, NULL);
/* do not make this a g_return_if_fail() */
if ( !(x >= 0 && x < drawable->width && y >= 0 && y < drawable->height))
return NULL;
dest = g_new (guchar, 5);
......@@ -457,7 +446,6 @@ Parasite *
gimp_drawable_parasite_find (const GimpDrawable *drawable,
const gchar *name)
{
g_return_val_if_fail (drawable != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
return parasite_list_find (drawable->parasites, name);
......@@ -478,7 +466,6 @@ gimp_drawable_parasite_list (GimpDrawable *drawable,
gchar **list;
gchar **cur;
g_return_val_if_fail (drawable != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
*count = parasite_list_length (drawable->parasites);
......@@ -493,7 +480,6 @@ void
gimp_drawable_parasite_attach (GimpDrawable *drawable,
Parasite *parasite)
{
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
/* only set the dirty bit manually if we can be saved and the new
......@@ -535,7 +521,6 @@ gimp_drawable_parasite_detach (GimpDrawable *drawable,
{
Parasite *p;
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
if (!(p = parasite_list_find (drawable->parasites, parasite)))
......@@ -553,7 +538,6 @@ gimp_drawable_parasite_detach (GimpDrawable *drawable,
Tattoo
gimp_drawable_get_tattoo (const GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, 0);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), 0);
return drawable->tattoo;
......@@ -562,7 +546,6 @@ gimp_drawable_get_tattoo (const GimpDrawable *drawable)
void
gimp_drawable_set_tattoo (GimpDrawable *drawable, Tattoo val)
{
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
drawable->tattoo = val;
......@@ -571,7 +554,6 @@ gimp_drawable_set_tattoo (GimpDrawable *drawable, Tattoo val)
gboolean
gimp_drawable_is_rgb (GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
if (gimp_drawable_type (drawable) == RGBA_GIMAGE ||
......@@ -584,7 +566,6 @@ gimp_drawable_is_rgb (GimpDrawable *drawable)
gboolean
gimp_drawable_is_gray (GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
if (gimp_drawable_type (drawable) == GRAYA_GIMAGE ||
......@@ -597,7 +578,6 @@ gimp_drawable_is_gray (GimpDrawable *drawable)
gboolean
gimp_drawable_is_indexed (GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
if (gimp_drawable_type (drawable) == INDEXEDA_GIMAGE ||
......@@ -610,7 +590,6 @@ gimp_drawable_is_indexed (GimpDrawable *drawable)
TileManager *
gimp_drawable_data (GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
return drawable->tiles;
......@@ -621,7 +600,6 @@ gimp_drawable_shadow (GimpDrawable *drawable)
{
GImage *gimage;
g_return_val_if_fail (drawable != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
if (! (gimage = gimp_drawable_gimage (drawable)))
......@@ -634,7 +612,6 @@ gimp_drawable_shadow (GimpDrawable *drawable)
int
gimp_drawable_bytes (GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, -1);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), -1);
return drawable->bytes;
......@@ -643,7 +620,6 @@ gimp_drawable_bytes (GimpDrawable *drawable)
gint
gimp_drawable_width (GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, -1);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), -1);
return drawable->width;
......@@ -652,7 +628,6 @@ gimp_drawable_width (GimpDrawable *drawable)
gint
gimp_drawable_height (GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, -1);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), -1);
return drawable->height;
......@@ -663,7 +638,6 @@ gimp_drawable_offsets (GimpDrawable *drawable,
gint *off_x,
gint *off_y)
{
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
*off_x = drawable->offset_x;
......@@ -675,7 +649,6 @@ gimp_drawable_cmap (GimpDrawable *drawable)
{
GimpImage *gimage;
g_return_val_if_fail (drawable != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
gimage = gimp_drawable_gimage (drawable);
......@@ -687,7 +660,6 @@ gimp_drawable_cmap (GimpDrawable *drawable)
void
gimp_drawable_deallocate (GimpDrawable *drawable)
{
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
if (drawable->tiles)
......@@ -729,7 +701,6 @@ gimp_drawable_destroy (GtkObject *object)
{
GimpDrawable *drawable;
g_return_if_fail (object != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (object));
drawable = GIMP_DRAWABLE (object);
......@@ -763,7 +734,6 @@ gimp_drawable_configure (GimpDrawable *drawable,
gint bpp;
gboolean alpha;
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
if (!name)
......
This diff is collapsed.
......@@ -162,13 +162,13 @@ void gimp_image_delete_guide (GimpImage *, Guide *);
Parasite * gimp_image_parasite_find (const GimpImage *,
const gchar *name);
gchar ** gimp_image_parasite_list (GimpImage *image,
gchar ** gimp_image_parasite_list (GimpImage *gimage,
gint *count);
void gimp_image_parasite_attach (GimpImage *, Parasite *);
void gimp_image_parasite_detach (GimpImage *, const gchar *);
Tattoo gimp_image_get_new_tattoo (GimpImage *);
int gimp_image_set_tattoo_state (GimpImage *, Tattoo);
gboolean gimp_image_set_tattoo_state (GimpImage *, Tattoo);
Tattoo gimp_image_get_tattoo_state (GimpImage *);
void gimp_image_set_paths (GimpImage *, PathList *);
......
This diff is collapsed.
......@@ -162,13 +162,13 @@ void gimp_image_delete_guide (GimpImage *, Guide *);
Parasite * gimp_image_parasite_find (const GimpImage *,
const gchar *name);
gchar ** gimp_image_parasite_list (GimpImage *image,
gchar ** gimp_image_parasite_list (GimpImage *gimage,
gint *count);
void gimp_image_parasite_attach (GimpImage *, Parasite *);
void gimp_image_parasite_detach (GimpImage *, const gchar *);
Tattoo gimp_image_get_new_tattoo (GimpImage *);
int gimp_image_set_tattoo_state (GimpImage *, Tattoo);
gboolean gimp_image_set_tattoo_state (GimpImage *, Tattoo);
Tattoo gimp_image_get_tattoo_state (GimpImage *);
void gimp_image_set_paths (GimpImage *, PathList *);
......
This diff is collapsed.
......@@ -162,13 +162,13 @@ void gimp_image_delete_guide (GimpImage *, Guide *);
Parasite * gimp_image_parasite_find (const GimpImage *,
const gchar *name);
gchar ** gimp_image_parasite_list (GimpImage *image,
gchar ** gimp_image_parasite_list (GimpImage *gimage,
gint *count);
void gimp_image_parasite_attach (GimpImage *, Parasite *);
void gimp_image_parasite_detach (GimpImage *, const gchar *);
Tattoo gimp_image_get_new_tattoo (GimpImage *);
int gimp_image_set_tattoo_state (GimpImage *, Tattoo);
gboolean gimp_image_set_tattoo_state (GimpImage *, Tattoo);
Tattoo gimp_image_get_tattoo_state (GimpImage *);
void gimp_image_set_paths (GimpImage *, PathList *);
......
This diff is collapsed.
......@@ -162,13 +162,13 @@ void gimp_image_delete_guide (GimpImage *, Guide *);
Parasite * gimp_image_parasite_find (const GimpImage *,
const gchar *name);
gchar ** gimp_image_parasite_list (GimpImage *image,
gchar ** gimp_image_parasite_list (GimpImage *gimage,
gint *count);
void gimp_image_parasite_attach (GimpImage *, Parasite *);
void gimp_image_parasite_detach (GimpImage *, const gchar *);
Tattoo gimp_image_get_new_tattoo (GimpImage *);
int gimp_image_set_tattoo_state (GimpImage *, Tattoo);
gboolean gimp_image_set_tattoo_state (GimpImage *, Tattoo);
Tattoo gimp_image_get_tattoo_state (GimpImage *);
void gimp_image_set_paths (GimpImage *, PathList *);
......
This diff is collapsed.
......@@ -162,13 +162,13 @@ void gimp_image_delete_guide (GimpImage *, Guide *);
Parasite * gimp_image_parasite_find (const GimpImage *,
const gchar *name);
gchar ** gimp_image_parasite_list (GimpImage *image,
gchar ** gimp_image_parasite_list (GimpImage *gimage,
gint *count);
void gimp_image_parasite_attach (GimpImage *, Parasite *);
void gimp_image_parasite_detach (GimpImage *, const gchar *);
Tattoo gimp_image_get_new_tattoo (GimpImage *);
int gimp_image_set_tattoo_state (GimpImage *, Tattoo);
gboolean gimp_image_set_tattoo_state (GimpImage *, Tattoo);
Tattoo gimp_image_get_tattoo_state (GimpImage *);
void gimp_image_set_paths (GimpImage *, PathList *);
......
This diff is collapsed.
......@@ -162,13 +162,13 @@ void gimp_image_delete_guide (GimpImage *, Guide *);
Parasite * gimp_image_parasite_find (const GimpImage *,
const gchar *name);
gchar ** gimp_image_parasite_list (GimpImage *image,
gchar ** gimp_image_parasite_list (GimpImage *gimage,
gint *count);
void gimp_image_parasite_attach (GimpImage *, Parasite *);
void gimp_image_parasite_detach (GimpImage *, const gchar *);
Tattoo gimp_image_get_new_tattoo (GimpImage *);
int gimp_image_set_tattoo_state (GimpImage *, Tattoo);
gboolean gimp_image_set_tattoo_state (GimpImage *, Tattoo);
Tattoo gimp_image_get_tattoo_state (GimpImage *);
void gimp_image_set_paths (GimpImage *, PathList *);
......
......@@ -101,12 +101,12 @@ image_map_do (gpointer data)
}
ImageMap
image_map_create (void *gdisp_ptr,
image_map_create (void *gdisp_ptr,
GimpDrawable *drawable)
{
_ImageMap *_image_map;
_image_map = (_ImageMap *) g_malloc (sizeof (_ImageMap));
_image_map = g_new (_ImageMap, 1);
_image_map->gdisp = (GDisplay *) gdisp_ptr;
_image_map->drawable = drawable;
_image_map->undo_tiles = NULL;
......@@ -121,7 +121,7 @@ image_map_apply (ImageMap image_map,
void *user_data)
{
_ImageMap *_image_map;
int x1, y1, x2, y2;
gint x1, y1, x2, y2;
_image_map = (_ImageMap *) image_map;
_image_map->apply_func = apply_func;
......@@ -213,7 +213,7 @@ void
image_map_commit (ImageMap image_map)
{
_ImageMap *_image_map;
int x1, y1, x2, y2;
gint x1, y1, x2, y2;
_image_map = (_ImageMap *) image_map;
......@@ -300,7 +300,9 @@ image_map_abort (ImageMap image_map)
}
unsigned char *
image_map_get_color_at (ImageMap image_map, int x, int y)
image_map_get_color_at (ImageMap image_map,
gint x,
gint y)
{
Tile *tile;
unsigned char *src;
......@@ -312,12 +314,12 @@ image_map_get_color_at (ImageMap image_map, int x, int y)
_image_map = (_ImageMap *) image_map;
if( x >= 0 && x < gimp_drawable_width (_image_map->drawable) &&
if (x >= 0 && x < gimp_drawable_width (_image_map->drawable) &&
y >= 0 && y < gimp_drawable_height (_image_map->drawable))
{
/* Check if done damage to original image */
if(!_image_map->undo_tiles)
return (gimp_drawable_get_color_at(_image_map->drawable,x,y));
if (!_image_map->undo_tiles)
return (gimp_drawable_get_color_at (_image_map->drawable, x, y));
if (!image_map ||
(!gimp_drawable_gimage(_image_map->drawable) &&
......
This diff is collapsed.
......@@ -162,13 +162,13 @@ void gimp_image_delete_guide (GimpImage *, Guide *);
Parasite * gimp_image_parasite_find (const GimpImage *,
const gchar *name);
gchar ** gimp_image_parasite_list (GimpImage *image,
gchar ** gimp_image_parasite_list (GimpImage *gimage,
gint *count);
void gimp_image_parasite_attach (GimpImage *, Parasite *);
void gimp_image_parasite_detach (GimpImage *, const gchar *);
Tattoo gimp_image_get_new_tattoo (GimpImage *);
int gimp_image_set_tattoo_state (GimpImage *, Tattoo);
gboolean gimp_image_set_tattoo_state (GimpImage *, Tattoo);
Tattoo gimp_image_get_tattoo_state (GimpImage *);
void gimp_image_set_paths (GimpImage *, PathList *);
......
......@@ -365,7 +365,11 @@ fuzzy_select (GImage *gimage,
else
gimage_mask_undo (gimage);
drawable_offsets (drawable, &off_x, &off_y);
if (drawable) /* NULL if sample_merged is active */
drawable_offsets (drawable, &off_x, &off_y);
else
off_x = off_y = 0;
if (feather)
channel_feather (fuzzy_mask, gimage_get_mask (gimage),
feather_radius,
......
......@@ -63,7 +63,7 @@ gimp_drawable_class_init (GimpDrawableClass *class)
GtkObjectClass *object_class;
GtkType type = GIMP_TYPE_DRAWABLE;
object_class = GTK_OBJECT_CLASS(class);
object_class = GTK_OBJECT_CLASS (class);
parent_class = gtk_type_class (GIMP_TYPE_OBJECT);
gimp_drawable_signals[INVALIDATE_PREVIEW] =
......@@ -105,7 +105,6 @@ gimp_drawable_merge_shadow (GimpDrawable *drawable,
PixelRegion shadowPR;
int x1, y1, x2, y2;
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
gimage = gimp_drawable_gimage (drawable);
......@@ -135,7 +134,6 @@ gimp_drawable_fill (GimpDrawable *drawable,
guchar c[MAX_CHANNELS];
guchar i;
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
gimage = gimp_drawable_gimage (drawable);
......@@ -189,7 +187,6 @@ gimp_drawable_mask_bounds (GimpDrawable *drawable,
GimpImage *gimage;
gint off_x, off_y;
g_return_val_if_fail (drawable != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
gimage = gimp_drawable_gimage (drawable);
......@@ -217,7 +214,6 @@ gimp_drawable_invalidate_preview (GimpDrawable *drawable)
{
GimpImage *gimage;
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
drawable->preview_valid = FALSE;
......@@ -238,7 +234,6 @@ gimp_drawable_invalidate_preview (GimpDrawable *drawable)
GimpImage *
gimp_drawable_gimage (GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, NULL);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), NULL);
return drawable->gimage;
......@@ -248,7 +243,6 @@ void
gimp_drawable_set_gimage (GimpDrawable *drawable,
GimpImage *gimage)
{
g_return_if_fail (drawable != NULL);
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
if (gimage == NULL)
......@@ -262,7 +256,6 @@ gimp_drawable_set_gimage (GimpDrawable *drawable,
gboolean
gimp_drawable_has_alpha (GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
return drawable->has_alpha;
......@@ -271,7 +264,6 @@ gimp_drawable_has_alpha (GimpDrawable *drawable)
GimpImageType
gimp_drawable_type (GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, -1);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), -1);
return drawable->type;
......@@ -283,7 +275,6 @@ gimp_drawable_type_with_alpha (GimpDrawable *drawable)
GimpImageType type;
gboolean has_alpha;
g_return_val_if_fail (drawable != NULL, -1);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), -1);
type = gimp_drawable_type (drawable);
......@@ -310,7 +301,6 @@ gimp_drawable_type_with_alpha (GimpDrawable *drawable)
gboolean
gimp_drawable_visible (GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, FALSE);
g_return_val_if_fail (GIMP_IS_DRAWABLE (drawable), FALSE);
return drawable->visible;
......@@ -319,7 +309,6 @@ gimp_drawable_visible (GimpDrawable *drawable)
gchar *
gimp_drawable_get_name (GimpDrawable *drawable)
{
g_return_val_if_fail (drawable != NULL, NULL);