Hi

todo.txt contains this item:

> Check for unused functions, idea:
> http://blog.flameeyes.eu/2008/01/17/today-how-to-identify-unused-exported-functions-and-variables

I tried building several configurations of Vim-7.3a
(tiny, small, normal, big, huge) with different
GUIs (athena, motif, gtk2, gnome2) using the gcc
compilation flags and link options in above link:

   -ffunction-sections -fdata-sections
   -Wl,--gc-sections -Wl,--print-gc-section

It found a couple of unused functions.
Attached patch fixes it.

Cheers
-- Dominique

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
diff -r 290ee42cae85 src/gui.c
--- a/src/gui.c	Sat May 29 15:40:47 2010 +0200
+++ b/src/gui.c	Sat May 29 20:10:49 2010 +0200
@@ -3908,6 +3908,7 @@
  * Scrollbar stuff:
  */
 
+#if defined(FEAT_AUTOCMD) || defined(FEAT_WINDOWS) || defined(PROTO)
 /*
  * Called when something in the window layout has changed.
  */
@@ -3922,6 +3923,7 @@
     }
     need_mouse_correct = TRUE;
 }
+#endif
 
     void
 gui_update_scrollbars(force)
diff -r 290ee42cae85 src/gui_gtk_f.c
--- a/src/gui_gtk_f.c	Sat May 29 15:40:47 2010 +0200
+++ b/src/gui_gtk_f.c	Sat May 29 20:10:49 2010 +0200
@@ -172,12 +172,13 @@
     }
 }
 
+#if !defined(HAVE_GTK2) || defined(PROTO)
     void
 gtk_form_set_size(GtkForm *form, guint width, guint height)
 {
     g_return_if_fail(GTK_IS_FORM(form));
 
-    /* prevent unneccessary calls */
+    /* prevent useless calls */
     if (form->width == width && form->height == height)
 	return;
     form->width = width;
@@ -190,6 +191,7 @@
     gtk_container_queue_resize(GTK_CONTAINER(GTK_WIDGET(form)->parent));
 #endif
 }
+#endif
 
     void
 gtk_form_freeze(GtkForm *form)
diff -r 290ee42cae85 src/screen.c
--- a/src/screen.c	Sat May 29 15:40:47 2010 +0200
+++ b/src/screen.c	Sat May 29 20:10:49 2010 +0200
@@ -297,6 +297,8 @@
 #endif
 }
 
+#if defined(FEAT_RUBY) || defined(FEAT_VISUAL) || \
+    (defined(FEAT_CLIPBOARD) && defined(FEAT_X11)) || defined(PROTO)
 /*
  * update all windows that are editing the current buffer
  */
@@ -307,6 +309,7 @@
     redraw_curbuf_later(type);
     update_screen(type);
 }
+#endif
 
 /*
  * update_screen()
diff -r 290ee42cae85 src/term.c
--- a/src/term.c	Sat May 29 15:40:47 2010 +0200
+++ b/src/term.c	Sat May 29 20:10:49 2010 +0200
@@ -2609,6 +2609,8 @@
 	out_flush();
 }
 
+#if defined(FEAT_TITLE) || defined(FEAT_MOUSE_TTY) || defined(FEAT_GUI) \
+    || defined(FEAT_TERMRESPONSE) || defined(PROTO)
 /*
  * A never-padding out_str.
  * use this whenever you don't want to run the string through tputs.
@@ -2631,6 +2633,7 @@
     if (p_wd)
 	out_flush();
 }
+#endif
 
 /*
  * out_str(s): Put a character string a byte at a time into the output buffer.
@@ -4361,7 +4364,7 @@
 		 *  ###   Y cursor position padded to 3 digits
 		 * (s-x)  SHIFT key pressed - not pressed x not reporting
 		 * (c-x)  CTRL key pressed - not pressed x not reporting
-		 * \033\\ terminateing sequence
+		 * \033\\ terminating sequence
 		 */
 
 		p = tp + slen;
@@ -4607,7 +4610,7 @@
 # ifdef FEAT_MOUSE_PTERM
 	    if (key_name[0] == (int)KS_PTERM_MOUSE)
 	    {
-		int button, num_clicks, action, mc, mr;
+		int button, num_clicks, action;
 
 		p = tp + slen;
 

Raspunde prin e-mail lui