patch 9.0.1390: FOR_ALL_ macros are defined in an unexpected file
Problem: FOR_ALL_ macros are defined in an unexpected file.
Solution: Move FOR_ALL_ macros to macros.h. Add FOR_ALL_HASHTAB_ITEMS.
(Yegappan Lakshmanan, closes #12109)
diff --git a/src/window.c b/src/window.c
index a804b4f..a967f92 100644
--- a/src/window.c
+++ b/src/window.c
@@ -5622,7 +5622,7 @@
// If there already is an entry with "wi_win" set to NULL it
// must be removed, it would never be used.
// Skip "wip" itself, otherwise Coverity complains.
- for (wip2 = buf->b_wininfo; wip2 != NULL; wip2 = wip2->wi_next)
+ FOR_ALL_BUF_WININFO(buf, wip2)
if (wip2 != wip && wip2->wi_win == NULL)
{
if (wip2->wi_next != NULL)
@@ -7378,7 +7378,7 @@
/*
* A snapshot of the window sizes, to restore them after closing the help
- * window.
+ * or other window.
* Only these fields are used:
* fr_layout
* fr_width
@@ -7390,6 +7390,7 @@
/*
* Create a snapshot of the current frame sizes.
+ * "idx" is SNAP_HELP_IDX or SNAP_AUCMD_IDX.
*/
void
make_snapshot(int idx)
@@ -7473,6 +7474,7 @@
* Restore a previously created snapshot, if there is any.
* This is only done if the screen size didn't change and the window layout is
* still the same.
+ * "idx" is SNAP_HELP_IDX or SNAP_AUCMD_IDX.
*/
void
restore_snapshot(