comparison src/menubar.c @ 269:b2472a1930f2 r20-5b33

Import from CVS: tag r20-5b33
author cvs
date Mon, 13 Aug 2007 10:27:19 +0200
parents 405dd6d1825b
children c5d627a313b1
comparison
equal deleted inserted replaced
268:6ced69ccd85f 269:b2472a1930f2
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;
155 struct gcpro gcpro1; 154 struct gcpro gcpro1;
156 struct gui_item gui_item; 155 struct gui_item gui_item;
157 156
158 gui_item_init (&gui_item); 157 gui_item_init (&gui_item);
159 158 GCPRO_GUI_ITEM (&gui_item);
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]);
170 gcpro1.nvars = GUI_ITEM_GCPRO_COUNT;
171 159
172 EXTERNAL_LIST_LOOP (path_entry, path) 160 EXTERNAL_LIST_LOOP (path_entry, path)
173 { 161 {
174 /* Verify that DESC describes a menu, not single item */ 162 /* Verify that DESC describes a menu, not single item */
175 if (!CONSP (desc)) 163 if (!CONSP (desc))