Mercurial > vim
comparison src/evalvars.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 | 9f28cca2410a |
children | daef00e8d99f |
comparison
equal
deleted
inserted
replaced
32117:0741cc777264 | 32118:04d9dff67d99 |
---|---|
2315 d->dv_lock &= ~VAR_LOCKED; | 2315 d->dv_lock &= ~VAR_LOCKED; |
2316 if (deep < 0 || deep > 1) | 2316 if (deep < 0 || deep > 1) |
2317 { | 2317 { |
2318 // recursive: lock/unlock the items the List contains | 2318 // recursive: lock/unlock the items the List contains |
2319 todo = (int)d->dv_hashtab.ht_used; | 2319 todo = (int)d->dv_hashtab.ht_used; |
2320 for (hi = d->dv_hashtab.ht_array; todo > 0; ++hi) | 2320 FOR_ALL_HASHTAB_ITEMS(&d->dv_hashtab, hi, todo) |
2321 { | 2321 { |
2322 if (!HASHITEM_EMPTY(hi)) | 2322 if (!HASHITEM_EMPTY(hi)) |
2323 { | 2323 { |
2324 --todo; | 2324 --todo; |
2325 item_lock(&HI2DI(hi)->di_tv, deep - 1, lock, | 2325 item_lock(&HI2DI(hi)->di_tv, deep - 1, lock, |
3569 hashitem_T *hi; | 3569 hashitem_T *hi; |
3570 dictitem_T *v; | 3570 dictitem_T *v; |
3571 | 3571 |
3572 hash_lock(ht); | 3572 hash_lock(ht); |
3573 todo = (int)ht->ht_used; | 3573 todo = (int)ht->ht_used; |
3574 for (hi = ht->ht_array; todo > 0; ++hi) | 3574 FOR_ALL_HASHTAB_ITEMS(ht, hi, todo) |
3575 { | 3575 { |
3576 if (!HASHITEM_EMPTY(hi)) | 3576 if (!HASHITEM_EMPTY(hi)) |
3577 { | 3577 { |
3578 --todo; | 3578 --todo; |
3579 | 3579 |