From ade3020098a314600796289b2121cc883073b23b Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Sun, 1 Mar 1998 23:38:01 +0000 Subject: [PATCH] Make sure either the window or the depth is given when creating a pixmap. Sun Mar 1 17:40:58 1998 Owen Taylor * gdk/gdkpixmap.c: Make sure either the window or the depth is given when creating a pixmap. --- ChangeLog | 5 +++++ ChangeLog.pre-2-0 | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-2 | 5 +++++ ChangeLog.pre-2-4 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ gdk/gdkpixmap.c | 9 +++++---- gdk/x11/gdkpixmap-x11.c | 9 +++++---- 9 files changed, 45 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index f9c4bb9719..6de5e54424 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Mar 1 17:40:58 1998 Owen Taylor + + * gdk/gdkpixmap.c: Make sure either the window or + the depth is given when creating a pixmap. + Sun Mar 1 22:59:09 1998 Tim Janik * gtk/gtkstatusbar.h: diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index f9c4bb9719..6de5e54424 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,8 @@ +Sun Mar 1 17:40:58 1998 Owen Taylor + + * gdk/gdkpixmap.c: Make sure either the window or + the depth is given when creating a pixmap. + Sun Mar 1 22:59:09 1998 Tim Janik * gtk/gtkstatusbar.h: diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index f9c4bb9719..6de5e54424 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +Sun Mar 1 17:40:58 1998 Owen Taylor + + * gdk/gdkpixmap.c: Make sure either the window or + the depth is given when creating a pixmap. + Sun Mar 1 22:59:09 1998 Tim Janik * gtk/gtkstatusbar.h: diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index f9c4bb9719..6de5e54424 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,8 @@ +Sun Mar 1 17:40:58 1998 Owen Taylor + + * gdk/gdkpixmap.c: Make sure either the window or + the depth is given when creating a pixmap. + Sun Mar 1 22:59:09 1998 Tim Janik * gtk/gtkstatusbar.h: diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index f9c4bb9719..6de5e54424 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +Sun Mar 1 17:40:58 1998 Owen Taylor + + * gdk/gdkpixmap.c: Make sure either the window or + the depth is given when creating a pixmap. + Sun Mar 1 22:59:09 1998 Tim Janik * gtk/gtkstatusbar.h: diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index f9c4bb9719..6de5e54424 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +Sun Mar 1 17:40:58 1998 Owen Taylor + + * gdk/gdkpixmap.c: Make sure either the window or + the depth is given when creating a pixmap. + Sun Mar 1 22:59:09 1998 Tim Janik * gtk/gtkstatusbar.h: diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index f9c4bb9719..6de5e54424 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +Sun Mar 1 17:40:58 1998 Owen Taylor + + * gdk/gdkpixmap.c: Make sure either the window or + the depth is given when creating a pixmap. + Sun Mar 1 22:59:09 1998 Tim Janik * gtk/gtkstatusbar.h: diff --git a/gdk/gdkpixmap.c b/gdk/gdkpixmap.c index 48b072b91c..ab131e6aca 100644 --- a/gdk/gdkpixmap.c +++ b/gdk/gdkpixmap.c @@ -43,6 +43,8 @@ gdk_pixmap_new (GdkWindow *window, GdkWindowPrivate *private; GdkWindowPrivate *window_private; + g_return_val_if_fail ((window != NULL) || (depth != -1), NULL); + if (!window) window = (GdkWindow*) &gdk_root_parent; @@ -132,6 +134,7 @@ gdk_pixmap_create_from_data (GdkWindow *window, g_return_val_if_fail (data != NULL, NULL); g_return_val_if_fail (fg != NULL, NULL); g_return_val_if_fail (bg != NULL, NULL); + g_return_val_if_fail ((window != NULL) || (depth != -1), NULL); if (!window) window = (GdkWindow*) &gdk_root_parent; @@ -368,8 +371,7 @@ gdk_pixmap_create_from_xpm (GdkWindow *window, _GdkPixmapColor *colors = NULL, *color = NULL; gulong index; - if (!window) - window = (GdkWindow*) &gdk_root_parent; + g_return_val_if_fail (window != NULL, NULL); infile = fopen (filename, "rb"); if (infile != NULL) @@ -529,8 +531,7 @@ gdk_pixmap_create_from_xpm_d (GdkWindow *window, _GdkPixmapColor *colors = NULL, *color = NULL; gulong index; - if (!window) - window = (GdkWindow*) &gdk_root_parent; + g_return_val_if_fail (window != NULL, NULL); i = 0; buffer = data[i++]; diff --git a/gdk/x11/gdkpixmap-x11.c b/gdk/x11/gdkpixmap-x11.c index 48b072b91c..ab131e6aca 100644 --- a/gdk/x11/gdkpixmap-x11.c +++ b/gdk/x11/gdkpixmap-x11.c @@ -43,6 +43,8 @@ gdk_pixmap_new (GdkWindow *window, GdkWindowPrivate *private; GdkWindowPrivate *window_private; + g_return_val_if_fail ((window != NULL) || (depth != -1), NULL); + if (!window) window = (GdkWindow*) &gdk_root_parent; @@ -132,6 +134,7 @@ gdk_pixmap_create_from_data (GdkWindow *window, g_return_val_if_fail (data != NULL, NULL); g_return_val_if_fail (fg != NULL, NULL); g_return_val_if_fail (bg != NULL, NULL); + g_return_val_if_fail ((window != NULL) || (depth != -1), NULL); if (!window) window = (GdkWindow*) &gdk_root_parent; @@ -368,8 +371,7 @@ gdk_pixmap_create_from_xpm (GdkWindow *window, _GdkPixmapColor *colors = NULL, *color = NULL; gulong index; - if (!window) - window = (GdkWindow*) &gdk_root_parent; + g_return_val_if_fail (window != NULL, NULL); infile = fopen (filename, "rb"); if (infile != NULL) @@ -529,8 +531,7 @@ gdk_pixmap_create_from_xpm_d (GdkWindow *window, _GdkPixmapColor *colors = NULL, *color = NULL; gulong index; - if (!window) - window = (GdkWindow*) &gdk_root_parent; + g_return_val_if_fail (window != NULL, NULL); i = 0; buffer = data[i++];