comparison src/scriptfile.c @ 32118:04d9dff67d99 v9.0.1390

patch 9.0.1390: FOR_ALL_ macros are defined in an unexpected file Commit: https://github.com/vim/vim/commit/14113fdf9cb3d588c0d1c3a210246b981cf5aad3 Author: Yegappan Lakshmanan <yegappan@yahoo.com> Date: Tue Mar 7 17:13:51 2023 +0000 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)
author Bram Moolenaar <Bram@vim.org>
date Tue, 07 Mar 2023 18:15:04 +0100
parents e16361210675
children 730eebd56f48
comparison
equal deleted inserted replaced
32117:0741cc777264 32118:04d9dff67d99
1670 // Script-local variables remain but "const" can be set again. 1670 // Script-local variables remain but "const" can be set again.
1671 // In Vim9 script variables will be cleared when "vim9script" 1671 // In Vim9 script variables will be cleared when "vim9script"
1672 // is encountered without the "noclear" argument. 1672 // is encountered without the "noclear" argument.
1673 ht = &SCRIPT_VARS(sid); 1673 ht = &SCRIPT_VARS(sid);
1674 todo = (int)ht->ht_used; 1674 todo = (int)ht->ht_used;
1675 for (hi = ht->ht_array; todo > 0; ++hi) 1675 FOR_ALL_HASHTAB_ITEMS(ht, hi, todo)
1676 if (!HASHITEM_EMPTY(hi)) 1676 if (!HASHITEM_EMPTY(hi))
1677 { 1677 {
1678 --todo; 1678 --todo;
1679 di = HI2DI(hi); 1679 di = HI2DI(hi);
1680 di->di_flags |= DI_FLAGS_RELOAD; 1680 di->di_flags |= DI_FLAGS_RELOAD;
2061 2061
2062 // Iterate through all the functions in the global function hash table 2062 // Iterate through all the functions in the global function hash table
2063 // looking for functions with script ID 'sid'. 2063 // looking for functions with script ID 'sid'.
2064 functbl = func_tbl_get(); 2064 functbl = func_tbl_get();
2065 todo = functbl->ht_used; 2065 todo = functbl->ht_used;
2066 for (hi = functbl->ht_array; todo > 0; ++hi) 2066 FOR_ALL_HASHTAB_ITEMS(functbl, hi, todo)
2067 { 2067 {
2068 ufunc_T *fp; 2068 ufunc_T *fp;
2069 2069
2070 if (HASHITEM_EMPTY(hi)) 2070 if (HASHITEM_EMPTY(hi))
2071 continue; 2071 continue;