From: Eli Zaretskii Date: Sat, 13 Oct 2007 12:11:14 +0000 (+0000) Subject: (grow_menu_items): Use larger_vector. X-Git-Tag: emacs-pretest-23.0.90~10357 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=71d00ce4ae4b180c784879beaff9bafd81c29989;p=emacs.git (grow_menu_items): Use larger_vector. --- 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 + + * 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 * 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. */