comparison src/menubar.c @ 261:405dd6d1825b r20-5b29

Import from CVS: tag r20-5b29
author cvs
date Mon, 13 Aug 2007 10:23:51 +0200
parents 11cf20601dec
children b2472a1930f2
comparison
equal deleted inserted replaced
260:052205f7dd5f 261:405dd6d1825b
149 See also 'find-menu-item' 149 See also 'find-menu-item'
150 */ 150 */
151 (desc, path)) 151 (desc, path))
152 { 152 {
153 Lisp_Object path_entry, submenu_desc, submenu; 153 Lisp_Object path_entry, submenu_desc, submenu;
154 Lisp_Object *gui_item_array;
154 struct gcpro gcpro1; 155 struct gcpro gcpro1;
155 struct gui_item gui_item; 156 struct gui_item gui_item;
156 157
157 gui_item_init (&gui_item); 158 gui_item_init (&gui_item);
158 GCPRO1 (gui_item); 159
160 /*
161 * gui_item is a struct containing a bunch of Lisp_Object
162 * members. We need to GC-protect all the member slots.
163 * Rather than build a long chain of individual gcpro structs
164 * that protect the slots individually, we protect all the
165 * member slots by pretending the struct is an array. ANSI C
166 * requires tihs hack to work, ugly though it is.
167 */
168 gui_item_array = (Lisp_Object *) &gui_item;
169 GCPRO1 (gui_item_array[0]);
159 gcpro1.nvars = GUI_ITEM_GCPRO_COUNT; 170 gcpro1.nvars = GUI_ITEM_GCPRO_COUNT;
160 171
161 EXTERNAL_LIST_LOOP (path_entry, path) 172 EXTERNAL_LIST_LOOP (path_entry, path)
162 { 173 {
163 /* Verify that DESC describes a menu, not single item */ 174 /* Verify that DESC describes a menu, not single item */