comparison src/gui_athena.c @ 19934:3ff714d765ba v8.2.0523

patch 8.2.0523: loops are repeated Commit: https://github.com/vim/vim/commit/00d253e2b2f435a5386582c3f857008e7ac355c2 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Apr 6 22:13:01 2020 +0200 patch 8.2.0523: loops are repeated Problem: Loops are repeated. Solution: Use FOR_ALL_ macros. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5882)
author Bram Moolenaar <Bram@vim.org>
date Mon, 06 Apr 2020 22:15:39 +0200
parents 79e10adc821d
children fcccc29bd386
comparison
equal deleted inserted replaced
19933:005e707a7988 19934:3ff714d765ba
952 // each one. The menu bar height is set to the maximum of all 952 // each one. The menu bar height is set to the maximum of all
953 // the heights. 953 // the heights.
954 vimmenu_T *mp; 954 vimmenu_T *mp;
955 int max_height = 9999; 955 int max_height = 9999;
956 956
957 for (mp = root_menu; mp != NULL; mp = mp->next) 957 FOR_ALL_MENUS(mp)
958 { 958 {
959 if (menu_is_menubar(mp->dname)) 959 if (menu_is_menubar(mp->dname))
960 { 960 {
961 Dimension height; 961 Dimension height;
962 962
1278 if (text != 0) 1278 if (text != 0)
1279 { 1279 {
1280 vimmenu_T *toolbar; 1280 vimmenu_T *toolbar;
1281 vimmenu_T *cur; 1281 vimmenu_T *cur;
1282 1282
1283 for (toolbar = root_menu; toolbar; toolbar = toolbar->next) 1283 FOR_ALL_MENUS(toolbar)
1284 if (menu_is_toolbar(toolbar->dname)) 1284 if (menu_is_toolbar(toolbar->dname))
1285 break; 1285 break;
1286 // Assumption: toolbar is NULL if there is no toolbar, 1286 // Assumption: toolbar is NULL if there is no toolbar,
1287 // otherwise it contains the toolbar menu structure. 1287 // otherwise it contains the toolbar menu structure.
1288 // 1288 //
1630 1630
1631 // First, popdown any siblings that may have menus popped up 1631 // First, popdown any siblings that may have menus popped up
1632 { 1632 {
1633 vimmenu_T *i; 1633 vimmenu_T *i;
1634 1634
1635 for (i = menu->parent->children; i != NULL; i = i->next) 1635 FOR_ALL_CHILD_MENUS(menu->parent, i)
1636 { 1636 {
1637 if (i->submenu_id != NULL && XtIsManaged(i->submenu_id)) 1637 if (i->submenu_id != NULL && XtIsManaged(i->submenu_id))
1638 XtPopdown(i->submenu_id); 1638 XtPopdown(i->submenu_id);
1639 } 1639 }
1640 } 1640 }