Re: static correctness



At 20:11 26.10.01 +0200, Tim Janik wrote:
>On Fri, 26 Oct 2001, Hans Breuer wrote:
>
>> [...]
>> Would a patch to correct this be accepted and if so
>> be required for review? (It would be quite large and overly
>> simple.)
>
>fixing static-ness will definitely be accepted.
>postiong the patch here when asking for aproval won't hurt
>though and might speed up matters.
>
You asked for it, here it comes:
Static-Ness part one - Gtk

	Hans


	* gtk/gtkbbox.c gtk/gtkctree.c gtk/gtkhbbox.c
	  gtk/gtkimmulticontext.c gtk/gtklabel.c gtk/gtkliststore.c
	  gtk/gtkmenu.c gtk/gtkpaned.c gtk/gtkrc.c gtk/gtkscale.c
	  gtk/gtkstyle.c gtk/gtktextbuffer.c gtk/gtktextlayout.c
	  gtk/gtktexttag.c gtk/gtktexttagtable.c gtk/gtktextview.c
	  gtk/gtktreestore.c gtk/gtkvbbox.c : 
	to simplify parsing for exported functions:
	- made implementation signature static, when the local 
	  prototype already was
	- put the functions return value on it's own line
	- added as space between the function name and the 
	  opening bracket

diff --exclude-from=c:\util\tool\diff.ign -u -r from-cvs/gtk+/gtk/gtkbbox.c
my-gtk/gtk+/gtk/gtkbbox.c
--- from-cvs/gtk+/gtk/gtkbbox.c	Fri Jul 20 12:32:02 2001
+++ my-gtk/gtk+/gtk/gtkbbox.c	Fri Oct 26 22:27:54 2001
@@ -263,21 +263,25 @@
 
 /* set per widget values for spacing, child size and child internal
padding */
 
-void gtk_button_box_set_child_size (GtkButtonBox *widget, gint width, gint
height)
+void 
+gtk_button_box_set_child_size (GtkButtonBox *widget, 
+                               gint width, gint height)
 {
   widget->child_min_width = width;
   widget->child_min_height = height;
 }
 
-void gtk_button_box_set_child_ipadding (GtkButtonBox *widget,
-					gint ipad_x, gint ipad_y)
+void 
+gtk_button_box_set_child_ipadding (GtkButtonBox *widget,
+                                   gint ipad_x, gint ipad_y)
 {
   widget->child_ipad_x = ipad_x;
   widget->child_ipad_y = ipad_y;
 }
 
-void gtk_button_box_set_layout (GtkButtonBox *widget, 
-				GtkButtonBoxStyle layout_style)
+void
+gtk_button_box_set_layout (GtkButtonBox      *widget, 
+                           GtkButtonBoxStyle  layout_style)
 {
   g_return_if_fail (layout_style >= GTK_BUTTONBOX_DEFAULT_STYLE &&
 		    layout_style <= GTK_BUTTONBOX_END);
@@ -293,15 +297,17 @@
 
 /* get per widget values for spacing, child size and child internal
padding */
 
-void gtk_button_box_get_child_size (GtkButtonBox *widget,
-				     gint *width, gint *height)
+void 
+gtk_button_box_get_child_size (GtkButtonBox *widget,
+                               gint *width, gint *height)
 {
   *width  = widget->child_min_width;
   *height = widget->child_min_height;
 }
 
-void gtk_button_box_get_child_ipadding (GtkButtonBox *widget,
-					 gint* ipad_x, gint *ipad_y)
+void
+gtk_button_box_get_child_ipadding (GtkButtonBox *widget,
+                                   gint* ipad_x, gint *ipad_y)
 {
   *ipad_x = widget->child_ipad_x;
   *ipad_y = widget->child_ipad_y;
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gtk+/gtk/gtkctree.c my-gtk/gtk+/gtk/gtkctree.c
--- from-cvs/gtk+/gtk/gtkctree.c	Wed Oct 24 20:28:56 2001
+++ my-gtk/gtk+/gtk/gtkctree.c	Fri Oct 26 22:31:16 2001
@@ -5223,8 +5223,9 @@
   gtk_clist_moveto (clist, row, column, row_align, col_align);
 }
 
-GtkVisibility gtk_ctree_node_is_visible (GtkCTree     *ctree,
-                                         GtkCTreeNode *node)
+GtkVisibility 
+gtk_ctree_node_is_visible (GtkCTree     *ctree,
+                           GtkCTreeNode *node)
 {
   gint row;
   
@@ -6128,13 +6129,13 @@
 /* dummy boxed type definition, used so that the GtkCTreeNode signal
  * arguments have a reasonable type.
  */
-gpointer
+static gpointer
 ctree_node_copy (gpointer boxed)
 {
   return boxed;
 }
 
-void
+static void
 ctree_node_free (gpointer boxed)
 {
   /* nothing */
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gtk+/gtk/gtkhbbox.c my-gtk/gtk+/gtk/gtkhbbox.c
--- from-cvs/gtk+/gtk/gtkhbbox.c	Fri Jul 20 12:32:20 2001
+++ my-gtk/gtk+/gtk/gtkhbbox.c	Fri Oct 26 22:39:48 2001
@@ -92,7 +92,8 @@
 
 /* set default value for spacing */
 
-void gtk_hbutton_box_set_spacing_default (gint spacing)
+void 
+gtk_hbutton_box_set_spacing_default (gint spacing)
 {
   default_spacing = spacing;
 }
@@ -100,7 +101,8 @@
 
 /* set default value for layout style */
 
-void gtk_hbutton_box_set_layout_default (GtkButtonBoxStyle layout)
+void 
+gtk_hbutton_box_set_layout_default (GtkButtonBoxStyle layout)
 {
   g_return_if_fail (layout >= GTK_BUTTONBOX_DEFAULT_STYLE &&
 		    layout <= GTK_BUTTONBOX_END);
@@ -110,7 +112,8 @@
 
 /* get default value for spacing */
 
-gint gtk_hbutton_box_get_spacing_default (void)
+gint 
+gtk_hbutton_box_get_spacing_default (void)
 {
   return default_spacing;
 }
@@ -118,7 +121,8 @@
 
 /* get default value for layout style */
 
-GtkButtonBoxStyle gtk_hbutton_box_get_layout_default (void)
+GtkButtonBoxStyle
+gtk_hbutton_box_get_layout_default (void)
 {
   return default_layout_style;
 }
Only in my-gtk/gtk+/gtk: gtkhsv-optimization
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gtk+/gtk/gtkimmulticontext.c my-gtk/gtk+/gtk/gtkimmulticontext.c
--- from-cvs/gtk+/gtk/gtkimmulticontext.c	Wed Oct 24 20:29:02 2001
+++ my-gtk/gtk+/gtk/gtkimmulticontext.c	Fri Oct 26 23:16:36 2001
@@ -46,11 +46,11 @@
 static void     gtk_im_multicontext_set_cursor_location (GtkIMContext
      *context,
 							GdkRectangle		*area);
 
-void            gtk_im_multicontext_preedit_start_cb   (GtkIMContext
     *slave,
+static void     gtk_im_multicontext_preedit_start_cb   (GtkIMContext
     *slave,
 							GtkIMMulticontext       *multicontext);
-void            gtk_im_multicontext_preedit_end_cb     (GtkIMContext
     *slave,
+static void     gtk_im_multicontext_preedit_end_cb     (GtkIMContext
     *slave,
 							GtkIMMulticontext       *multicontext);
-void            gtk_im_multicontext_preedit_changed_cb (GtkIMContext
     *slave,
+static void     gtk_im_multicontext_preedit_changed_cb (GtkIMContext
     *slave,
 							GtkIMMulticontext       *multicontext);
 void            gtk_im_multicontext_commit_cb          (GtkIMContext
     *slave,
 							const gchar             *str,
@@ -294,21 +294,21 @@
     gtk_im_context_set_cursor_location (slave, area);
 }
 
-void
+static void
 gtk_im_multicontext_preedit_start_cb   (GtkIMContext      *slave,
 					GtkIMMulticontext *multicontext)
 {
   g_signal_emit_by_name (multicontext, "preedit_start");
 }
 
-void
+static void
 gtk_im_multicontext_preedit_end_cb (GtkIMContext      *slave,
 				    GtkIMMulticontext *multicontext)
 {
   g_signal_emit_by_name (multicontext, "preedit_end");
 }
 
-void
+static void
 gtk_im_multicontext_preedit_changed_cb (GtkIMContext      *slave,
 					GtkIMMulticontext *multicontext)
 {
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gtk+/gtk/gtklabel.c my-gtk/gtk+/gtk/gtklabel.c
--- from-cvs/gtk+/gtk/gtklabel.c	Wed Oct 24 20:29:04 2001
+++ my-gtk/gtk+/gtk/gtklabel.c	Fri Oct 26 21:23:46 2001
@@ -1794,7 +1794,7 @@
   return TRUE;
 }
 
-void
+static void
 gtk_label_set_uline_text_internal (GtkLabel    *label,
 				   const gchar *str)
 {
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gtk+/gtk/gtkliststore.c my-gtk/gtk+/gtk/gtkliststore.c
--- from-cvs/gtk+/gtk/gtkliststore.c	Wed Oct 24 20:29:06 2001
+++ my-gtk/gtk+/gtk/gtkliststore.c	Fri Oct 26 22:43:44 2001
@@ -597,7 +597,7 @@
   return FALSE;
 }
 
-gboolean
+static gboolean
 gtk_list_store_real_set_value (GtkListStore *list_store,
 			       GtkTreeIter  *iter,
 			       gint          column,
diff --exclude-from=c:\util\tool\diff.ign -u -r from-cvs/gtk+/gtk/gtkmenu.c
my-gtk/gtk+/gtk/gtkmenu.c
--- from-cvs/gtk+/gtk/gtkmenu.c	Fri Sep 28 11:03:00 2001
+++ my-gtk/gtk+/gtk/gtkmenu.c	Fri Oct 26 21:27:10 2001
@@ -490,7 +490,7 @@
   gtk_widget_unref (GTK_WIDGET (menu));
 }
 
-void 
+static void 
 gtk_menu_remove (GtkContainer *container,
 		 GtkWidget    *widget)
 {
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gtk+/gtk/gtkpaned.c my-gtk/gtk+/gtk/gtkpaned.c
--- from-cvs/gtk+/gtk/gtkpaned.c	Fri Jul 20 12:32:34 2001
+++ my-gtk/gtk+/gtk/gtkpaned.c	Fri Oct 26 22:46:22 2001
@@ -497,10 +497,10 @@
 }
 
 void
-gtk_paned_compute_position(GtkPaned *paned,
-			   gint      allocation,
-			   gint      child1_req,
-			   gint      child2_req)
+gtk_paned_compute_position (GtkPaned *paned,
+			    gint      allocation,
+			    gint      child1_req,
+			    gint      child2_req)
 {
   gint old_position;
   
diff --exclude-from=c:\util\tool\diff.ign -u -r from-cvs/gtk+/gtk/gtkrc.c
my-gtk/gtk+/gtk/gtkrc.c
--- from-cvs/gtk+/gtk/gtkrc.c	Wed Oct 24 20:29:10 2001
+++ my-gtk/gtk+/gtk/gtkrc.c	Fri Oct 26 23:18:56 2001
@@ -369,7 +369,7 @@
 }
 
 gchar *
-gtk_rc_get_theme_dir(void)
+gtk_rc_get_theme_dir (void)
 {
   gchar *var, *path;
 
@@ -387,7 +387,7 @@
 }
 
 gchar *
-gtk_rc_get_module_dir(void)
+gtk_rc_get_module_dir (void)
 {
   return gtk_rc_make_default_dir ("engines");
 }
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gtk+/gtk/gtkscale.c my-gtk/gtk+/gtk/gtkscale.c
--- from-cvs/gtk+/gtk/gtkscale.c	Wed Oct 24 20:29:10 2001
+++ my-gtk/gtk+/gtk/gtkscale.c	Fri Oct 26 21:30:54 2001
@@ -87,7 +87,7 @@
   return scale_type;
 }
 
-gboolean
+static gboolean
 single_string_accumulator (GSignalInvocationHint *ihint,
                            GValue                *return_accu,
                            const GValue          *handler_return,
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gtk+/gtk/gtkstyle.c my-gtk/gtk+/gtk/gtkstyle.c
--- from-cvs/gtk+/gtk/gtkstyle.c	Wed Oct 24 20:29:14 2001
+++ my-gtk/gtk+/gtk/gtkstyle.c	Fri Oct 26 21:35:32 2001
@@ -1354,7 +1354,7 @@
   return &pcache->value;
 }
 
-GdkPixmap *
+static GdkPixmap *
 load_bg_image (GdkColormap *colormap,
 	       GdkColor    *bg_color,
 	       const gchar *filename)
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gtk+/gtk/gtktextbuffer.c my-gtk/gtk+/gtk/gtktextbuffer.c
--- from-cvs/gtk+/gtk/gtktextbuffer.c	Wed Oct 24 20:29:18 2001
+++ my-gtk/gtk+/gtk/gtktextbuffer.c	Fri Oct 26 21:40:20 2001
@@ -300,7 +300,7 @@
                   0);  
 }
 
-void
+static void
 gtk_text_buffer_init (GtkTextBuffer *buffer)
 {
   buffer->clipboard_contents_buffers = NULL;
@@ -440,7 +440,6 @@
  */
 
 static void
-
 gtk_text_buffer_real_insert_text (GtkTextBuffer *buffer,
                                   GtkTextIter *iter,
                                   const gchar *text,
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gtk+/gtk/gtktextlayout.c my-gtk/gtk+/gtk/gtktextlayout.c
--- from-cvs/gtk+/gtk/gtktextlayout.c	Wed Oct 24 20:29:20 2001
+++ my-gtk/gtk+/gtk/gtktextlayout.c	Fri Oct 26 21:45:58 2001
@@ -210,7 +210,7 @@
                   GTK_TYPE_INT);
 }
 
-void
+static void
 gtk_text_layout_init (GtkTextLayout *text_layout)
 {
   text_layout->cursor_visible = TRUE;
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gtk+/gtk/gtktexttag.c my-gtk/gtk+/gtk/gtktexttag.c
--- from-cvs/gtk+/gtk/gtktexttag.c	Thu Oct 25 21:34:16 2001
+++ my-gtk/gtk+/gtk/gtktexttag.c	Fri Oct 26 21:47:34 2001
@@ -629,7 +629,7 @@
                   GTK_TYPE_TEXT_ITER);
 }
 
-void
+static void
 gtk_text_tag_init (GtkTextTag *text_tag)
 {
   /* 0 is basically a fine way to initialize everything in the
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gtk+/gtk/gtktexttagtable.c my-gtk/gtk+/gtk/gtktexttagtable.c
--- from-cvs/gtk+/gtk/gtktexttagtable.c	Fri Sep 28 11:03:14 2001
+++ my-gtk/gtk+/gtk/gtktexttagtable.c	Fri Sep 21 23:10:44 2001
@@ -106,7 +106,7 @@
                   G_TYPE_OBJECT);
 }
 
-void
+static void
 gtk_text_tag_table_init (GtkTextTagTable *table)
 {
   table->hash = g_hash_table_new (g_str_hash, g_str_equal);
@@ -149,7 +149,7 @@
   table = GTK_TEXT_TAG_TABLE (object);
 
   gtk_text_tag_table_foreach (table, foreach_unref, NULL);
-  
+
   g_hash_table_destroy (table->hash);
   g_slist_free (table->anonymous);
 
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gtk+/gtk/gtktextview.c my-gtk/gtk+/gtk/gtktextview.c
--- from-cvs/gtk+/gtk/gtktextview.c	Thu Oct 25 21:34:18 2001
+++ my-gtk/gtk+/gtk/gtktextview.c	Fri Oct 26 22:19:56 2001
@@ -920,7 +920,7 @@
                                 "toggle_overwrite", 0);
 }
 
-void
+static void
 gtk_text_view_init (GtkTextView *text_view)
 {
   GtkWidget *widget;
@@ -5779,7 +5779,7 @@
     }
 }
 
-void
+static void
 text_window_invalidate_rect (GtkTextWindow *win,
                              GdkRectangle  *rect)
 {
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gtk+/gtk/gtktreestore.c my-gtk/gtk+/gtk/gtktreestore.c
--- from-cvs/gtk+/gtk/gtktreestore.c	Thu Oct 25 21:34:22 2001
+++ my-gtk/gtk+/gtk/gtktreestore.c	Fri Oct 26 23:02:00 2001
@@ -714,7 +714,7 @@
 
 
 /* Does not emit a signal */
-gboolean
+static gboolean
 gtk_tree_store_real_set_value (GtkTreeStore *tree_store,
 			       GtkTreeIter  *iter,
 			       gint          column,
diff --exclude-from=c:\util\tool\diff.ign -u -r
from-cvs/gtk+/gtk/gtkvbbox.c my-gtk/gtk+/gtk/gtkvbbox.c
--- from-cvs/gtk+/gtk/gtkvbbox.c	Fri Jul 20 12:35:16 2001
+++ my-gtk/gtk+/gtk/gtkvbbox.c	Fri Oct 26 23:07:30 2001
@@ -92,7 +92,8 @@
 
 /* set default value for spacing */
 
-void gtk_vbutton_box_set_spacing_default (gint spacing)
+void
+gtk_vbutton_box_set_spacing_default (gint spacing)
 {
   default_spacing = spacing;
 }
@@ -100,7 +101,8 @@
 
 /* set default value for layout style */
 
-void gtk_vbutton_box_set_layout_default (GtkButtonBoxStyle layout)
+void
+gtk_vbutton_box_set_layout_default (GtkButtonBoxStyle layout)
 {
   g_return_if_fail (layout >= GTK_BUTTONBOX_DEFAULT_STYLE &&
 		    layout <= GTK_BUTTONBOX_END);
@@ -110,7 +112,8 @@
 
 /* get default value for spacing */
 
-gint gtk_vbutton_box_get_spacing_default (void)
+gint
+gtk_vbutton_box_get_spacing_default (void)
 {
   return default_spacing;
 }
@@ -119,7 +122,8 @@
 
 /* get default value for layout style */
 
-GtkButtonBoxStyle gtk_vbutton_box_get_layout_default (void)
+GtkButtonBoxStyle
+gtk_vbutton_box_get_layout_default (void)
 {
   return default_layout_style;
 }

-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to 
get along without it.                -- Dilbert



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