diff options
author | Bastien Montagne <b.mont29@gmail.com> | 2020-02-18 16:37:42 +0300 |
---|---|---|
committer | Bastien Montagne <b.mont29@gmail.com> | 2020-02-18 16:38:33 +0300 |
commit | ad9b91996209f76bb3658afeba426ecd3e8243e7 (patch) | |
tree | 4819a84b42811e1199833e18a4175f0a4078c2c1 /source/blender/blenkernel/BKE_main.h | |
parent | ce33388413a995c5791f4d768a6c7e41be470d5d (diff) |
Cleanup: protect parameters of `FOREACH_MAIN_ID` & co macros.
Diffstat (limited to 'source/blender/blenkernel/BKE_main.h')
-rw-r--r-- | source/blender/blenkernel/BKE_main.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/blenkernel/BKE_main.h b/source/blender/blenkernel/BKE_main.h index 8b46939c6d1..a263162e013 100644 --- a/source/blender/blenkernel/BKE_main.h +++ b/source/blender/blenkernel/BKE_main.h @@ -165,9 +165,9 @@ struct GSet *BKE_main_gset_create(struct Main *bmain, struct GSet *gset); #define FOREACH_MAIN_LISTBASE_ID_BEGIN(_lb, _id) \ { \ - ID *_id_next = _lb->first; \ - for (_id = _id_next; _id != NULL; _id = _id_next) { \ - _id_next = _id->next; + ID *_id_next = (_lb)->first; \ + for ((_id) = _id_next; (_id) != NULL; (_id) = _id_next) { \ + _id_next = (_id)->next; #define FOREACH_MAIN_LISTBASE_ID_END \ } \ @@ -177,9 +177,9 @@ struct GSet *BKE_main_gset_create(struct Main *bmain, struct GSet *gset); #define FOREACH_MAIN_LISTBASE_BEGIN(_bmain, _lb) \ { \ ListBase *_lbarray[MAX_LIBARRAY]; \ - int _i = set_listbasepointers(_bmain, _lbarray); \ + int _i = set_listbasepointers((_bmain), _lbarray); \ while (_i--) { \ - _lb = _lbarray[_i]; + (_lb) = _lbarray[_i]; #define FOREACH_MAIN_LISTBASE_END \ } \ @@ -193,8 +193,8 @@ struct GSet *BKE_main_gset_create(struct Main *bmain, struct GSet *gset); #define FOREACH_MAIN_ID_BEGIN(_bmain, _id) \ { \ ListBase *_lb; \ - FOREACH_MAIN_LISTBASE_BEGIN (_bmain, _lb) { \ - FOREACH_MAIN_LISTBASE_ID_BEGIN (_lb, _id) + FOREACH_MAIN_LISTBASE_BEGIN ((_bmain), _lb) { \ + FOREACH_MAIN_LISTBASE_ID_BEGIN (_lb, (_id)) #define FOREACH_MAIN_ID_END \ FOREACH_MAIN_LISTBASE_ID_END; \ |