a small patch for gtkstyle.c



Hi,

here's a small patch that removes the calculation of the 
return value from sanitize_size() which was never used
and inlines this function. OK to commit?

I'm also wondering if you'd accept a patch that changes
places where gdk_draw_line() is called multiple times
with the same GC into a single call of gdk_draw_segments().
This would result in the same output (since gdk_draw_line
is implemented through gdk_draw_segments but probably
better performance. What do you think?


Salut, Sven


Index: gtk/gtkstyle.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkstyle.c,v
retrieving revision 1.98
diff -u -p -r1.98 gtkstyle.c
--- gtk/gtkstyle.c	2002/01/15 16:35:01	1.98
+++ gtk/gtkstyle.c	2002/01/27 14:49:25
@@ -1945,24 +1945,17 @@ gtk_default_render_icon (GtkStyle       
   return stated;
 }
 
-static gboolean
+static inline void
 sanitize_size (GdkWindow *window,
 	       gint      *width,
 	       gint      *height)
 {
-  gboolean set_bg = FALSE;
-
   if ((*width == -1) && (*height == -1))
-    {
-      set_bg = GDK_IS_WINDOW (window);
-      gdk_window_get_size (window, width, height);
-    }
+    gdk_window_get_size (window, width, height);
   else if (*width == -1)
     gdk_window_get_size (window, width, NULL);
   else if (*height == -1)
     gdk_window_get_size (window, NULL, height);
-
-  return set_bg;
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]