aboutsummaryrefslogtreecommitdiffstats
path: root/src/menu.c
diff options
context:
space:
mode:
authorPaul Eggert2011-04-16 16:11:35 -0700
committerPaul Eggert2011-04-16 16:11:35 -0700
commitfd35b6f96777be3305879a9ca60ab5befb254042 (patch)
treedb72c649acdc7f53d9672fba88b6a08b3601cdda /src/menu.c
parentc4354cb4f4a3982331180439120ca72734d49cc5 (diff)
parent399c71d323b8beef139437311c78440d0033c652 (diff)
downloademacs-fd35b6f96777be3305879a9ca60ab5befb254042.tar.gz
emacs-fd35b6f96777be3305879a9ca60ab5befb254042.zip
Static checks with GCC 4.6.0 and non-default toolkits.
Diffstat (limited to 'src/menu.c')
-rw-r--r--src/menu.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/menu.c b/src/menu.c
index 3bfb74863ae..f637b92679a 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -180,6 +180,9 @@ grow_menu_items (void)
180 menu_items = larger_vector (menu_items, menu_items_allocated, Qnil); 180 menu_items = larger_vector (menu_items, menu_items_allocated, Qnil);
181} 181}
182 182
183#if (defined USE_X_TOOLKIT || defined USE_GTK || defined HAVE_NS \
184 || defined HAVE_NTGUI)
185
183/* Begin a submenu. */ 186/* Begin a submenu. */
184 187
185static void 188static void
@@ -204,6 +207,8 @@ push_submenu_end (void)
204 menu_items_submenu_depth--; 207 menu_items_submenu_depth--;
205} 208}
206 209
210#endif /* USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI */
211
207/* Indicate boundary between left and right. */ 212/* Indicate boundary between left and right. */
208 213
209static void 214static void
@@ -368,34 +373,34 @@ single_menu_item (Lisp_Object key, Lisp_Object item, Lisp_Object dummy, void *sk
368 if (skp->notbuttons) 373 if (skp->notbuttons)
369 /* The first button. Line up previous items in this menu. */ 374 /* The first button. Line up previous items in this menu. */
370 { 375 {
371 int index = skp->notbuttons; /* Index for first item this menu. */ 376 int idx = skp->notbuttons; /* Index for first item this menu. */
372 int submenu = 0; 377 int submenu = 0;
373 Lisp_Object tem; 378 Lisp_Object tem;
374 while (index < menu_items_used) 379 while (idx < menu_items_used)
375 { 380 {
376 tem 381 tem
377 = XVECTOR (menu_items)->contents[index + MENU_ITEMS_ITEM_NAME]; 382 = XVECTOR (menu_items)->contents[idx + MENU_ITEMS_ITEM_NAME];
378 if (NILP (tem)) 383 if (NILP (tem))
379 { 384 {
380 index++; 385 idx++;
381 submenu++; /* Skip sub menu. */ 386 submenu++; /* Skip sub menu. */
382 } 387 }
383 else if (EQ (tem, Qlambda)) 388 else if (EQ (tem, Qlambda))
384 { 389 {
385 index++; 390 idx++;
386 submenu--; /* End sub menu. */ 391 submenu--; /* End sub menu. */
387 } 392 }
388 else if (EQ (tem, Qt)) 393 else if (EQ (tem, Qt))
389 index += 3; /* Skip new pane marker. */ 394 idx += 3; /* Skip new pane marker. */
390 else if (EQ (tem, Qquote)) 395 else if (EQ (tem, Qquote))
391 index++; /* Skip a left, right divider. */ 396 idx++; /* Skip a left, right divider. */
392 else 397 else
393 { 398 {
394 if (!submenu && SREF (tem, 0) != '\0' 399 if (!submenu && SREF (tem, 0) != '\0'
395 && SREF (tem, 0) != '-') 400 && SREF (tem, 0) != '-')
396 XVECTOR (menu_items)->contents[index + MENU_ITEMS_ITEM_NAME] 401 XVECTOR (menu_items)->contents[idx + MENU_ITEMS_ITEM_NAME]
397 = concat2 (build_string (" "), tem); 402 = concat2 (build_string (" "), tem);
398 index += MENU_ITEMS_ITEM_LENGTH; 403 idx += MENU_ITEMS_ITEM_LENGTH;
399 } 404 }
400 } 405 }
401 skp->notbuttons = 0; 406 skp->notbuttons = 0;