From 71d00ce4ae4b180c784879beaff9bafd81c29989 Mon Sep 17 00:00:00 2001
From: Eli Zaretskii <eliz@gnu.org>
Date: Sat, 13 Oct 2007 12:11:14 +0000
Subject: [PATCH] (grow_menu_items): Use larger_vector.

---
 src/ChangeLog | 11 +++++++++++
 src/macmenu.c |  9 +--------
 src/w32menu.c |  8 +-------
 src/xmenu.c   |  9 +--------
 4 files changed, 14 insertions(+), 23 deletions(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index 528e793bf11..16b55e97a6d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,14 @@
+2007-10-05  Dmitry Antipov <dmantipov@yandex.ru>
+
+	* buffer.c (add_overlay_mod_hooklist):
+	* ccl.c (Fregister_ccl_program, Fregister_code_conversion_map):
+	* fontset.c (make_fontset):
+	* keyboard.c (GROW_RAW_KEYBUF, menu_bar_items, menu_bar_item)
+	(append_tool_bar_item):
+	* macmenu.c (grow_menu_items):
+	* w32menu.c (grow_menu_items):	
+	* xmenu.c (grow_menu_items): Use larger_vector.
+	
 2007-10-13  Eli Zaretskii  <eliz@gnu.org>
 
 	* msdos.c (dos_rawgetc): Undo last change (there's no ``leaving
diff --git a/src/macmenu.c b/src/macmenu.c
index 8305c89ee68..aa0be0bdc2e 100644
--- a/src/macmenu.c
+++ b/src/macmenu.c
@@ -347,15 +347,8 @@ save_menu_items ()
 static void
 grow_menu_items ()
 {
-  Lisp_Object old;
-  int old_size = menu_items_allocated;
-  old = menu_items;
-
   menu_items_allocated *= 2;
-
-  menu_items = Fmake_vector (make_number (menu_items_allocated), Qnil);
-  bcopy (XVECTOR (old)->contents, XVECTOR (menu_items)->contents,
-	 old_size * sizeof (Lisp_Object));
+  menu_items = larger_vector (menu_items, menu_items_allocated, Qnil);
 }
 
 /* Begin a submenu.  */
diff --git a/src/w32menu.c b/src/w32menu.c
index e5638cc4bfd..a94be08902d 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -318,14 +318,8 @@ discard_menu_items ()
 static void
 grow_menu_items ()
 {
-  Lisp_Object old;
-  int old_size = menu_items_allocated;
-  old = menu_items;
-
   menu_items_allocated *= 2;
-  menu_items = Fmake_vector (make_number (menu_items_allocated), Qnil);
-  bcopy (XVECTOR (old)->contents, XVECTOR (menu_items)->contents,
-	 old_size * sizeof (Lisp_Object));
+  menu_items = larger_vector (menu_items, menu_items_allocated, Qnil);
 }
 
 /* Begin a submenu.  */
diff --git a/src/xmenu.c b/src/xmenu.c
index 76b316d026f..14c72397110 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -354,15 +354,8 @@ save_menu_items ()
 static void
 grow_menu_items ()
 {
-  Lisp_Object old;
-  int old_size = menu_items_allocated;
-  old = menu_items;
-
   menu_items_allocated *= 2;
-
-  menu_items = Fmake_vector (make_number (menu_items_allocated), Qnil);
-  bcopy (XVECTOR (old)->contents, XVECTOR (menu_items)->contents,
-	 old_size * sizeof (Lisp_Object));
+  menu_items = larger_vector (menu_items, menu_items_allocated, Qnil);
 }
 
 /* Begin a submenu.  */
-- 
2.39.5