comparison src/testing.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 0d27ddce621d
children c9b5b21a0369
comparison
equal deleted inserted replaced
32117:0741cc777264 32118:04d9dff67d99
179 got_tv->vval.v_dict = dict_alloc(); 179 got_tv->vval.v_dict = dict_alloc();
180 if (exp_tv->vval.v_dict == NULL || got_tv->vval.v_dict == NULL) 180 if (exp_tv->vval.v_dict == NULL || got_tv->vval.v_dict == NULL)
181 return; 181 return;
182 182
183 todo = (int)exp_d->dv_hashtab.ht_used; 183 todo = (int)exp_d->dv_hashtab.ht_used;
184 for (hi = exp_d->dv_hashtab.ht_array; todo > 0; ++hi) 184 FOR_ALL_HASHTAB_ITEMS(&exp_d->dv_hashtab, hi, todo)
185 { 185 {
186 if (!HASHITEM_EMPTY(hi)) 186 if (!HASHITEM_EMPTY(hi))
187 { 187 {
188 item2 = dict_find(got_d, hi->hi_key, -1); 188 item2 = dict_find(got_d, hi->hi_key, -1);
189 if (item2 == NULL || !tv_equal(&HI2DI(hi)->di_tv, 189 if (item2 == NULL || !tv_equal(&HI2DI(hi)->di_tv,
202 } 202 }
203 } 203 }
204 204
205 // Add items only present in got_d. 205 // Add items only present in got_d.
206 todo = (int)got_d->dv_hashtab.ht_used; 206 todo = (int)got_d->dv_hashtab.ht_used;
207 for (hi = got_d->dv_hashtab.ht_array; todo > 0; ++hi) 207 FOR_ALL_HASHTAB_ITEMS(&got_d->dv_hashtab, hi, todo)
208 { 208 {
209 if (!HASHITEM_EMPTY(hi)) 209 if (!HASHITEM_EMPTY(hi))
210 { 210 {
211 item2 = dict_find(exp_d, hi->hi_key, -1); 211 item2 = dict_find(exp_d, hi->hi_key, -1);
212 if (item2 == NULL) 212 if (item2 == NULL)