diff options
author | Sverker Eriksson <sverker@erlang.org> | 2021-02-22 20:46:18 +0100 |
---|---|---|
committer | Sverker Eriksson <sverker@erlang.org> | 2021-02-23 14:02:24 +0100 |
commit | ec665844a22c0a938c9d944736778df6d204a015 (patch) | |
tree | 1159369d9b6a0706c646ddc73f266b9b3f29ca34 | |
parent | dfe5fa00cdfb322d7a3468475996a10221a0de99 (diff) | |
download | erlang-ec665844a22c0a938c9d944736778df6d204a015.tar.gz |
erts: Silence CodeChecker on empty loops
-rw-r--r-- | erts/emulator/beam/erl_ao_firstfit_alloc.c | 12 | ||||
-rw-r--r-- | erts/emulator/beam/erl_bestfit_alloc.c | 3 | ||||
-rw-r--r-- | erts/emulator/sys/common/erl_mmap.c | 3 |
3 files changed, 12 insertions, 6 deletions
diff --git a/erts/emulator/beam/erl_ao_firstfit_alloc.c b/erts/emulator/beam/erl_ao_firstfit_alloc.c index a11b762afe..e5b2fe41ca 100644 --- a/erts/emulator/beam/erl_ao_firstfit_alloc.c +++ b/erts/emulator/beam/erl_ao_firstfit_alloc.c @@ -603,9 +603,11 @@ rbt_delete(AOFF_RBTree_t** root, AOFF_RBTree_t* del) /* Find node to splice out */ if (!z->left || !z->right) y = z; - else + else { /* Set y to z:s successor */ - for(y = z->right; y->left; y = y->left); + for(y = z->right; y->left; y = y->left) + ; + } /* splice out y */ x = y->left ? y->left : y->right; spliced_is_black = IS_BLACK(y); @@ -1073,7 +1075,8 @@ static Block_t *aoff_first_fblk_in_mbc(Allctr_t *allctr, Carrier_t *carrier) AOFF_RBTree_t *blk; /* Descend to the rightmost block of the tree. */ - for (blk = crr->root; blk->right; blk = blk->right); + for (blk = crr->root; blk->right; blk = blk->right) + ; return (Block_t*)blk; } @@ -1093,7 +1096,8 @@ static Block_t *aoff_next_fblk_in_mbc(Allctr_t *allctr, Carrier_t *carrier, if (blk->left) { /* Descend to the rightmost block of the left subtree. */ - for (blk = blk->left; blk->right; blk = blk->right); + for (blk = blk->left; blk->right; blk = blk->right) + ; return (Block_t*)blk; } diff --git a/erts/emulator/beam/erl_bestfit_alloc.c b/erts/emulator/beam/erl_bestfit_alloc.c index 0ae39596a3..3951113364 100644 --- a/erts/emulator/beam/erl_bestfit_alloc.c +++ b/erts/emulator/beam/erl_bestfit_alloc.c @@ -434,7 +434,8 @@ tree_delete(Allctr_t *allctr, Block_t *del) y = z; else /* Set y to z:s successor */ - for(y = z->right; y->left; y = y->left); + for (y = z->right; y->left; y = y->left) + ; /* splice out y */ x = y->left ? y->left : y->right; spliced_is_black = IS_BLACK(y); diff --git a/erts/emulator/sys/common/erl_mmap.c b/erts/emulator/sys/common/erl_mmap.c index 890adbb7cb..03e673dcf1 100644 --- a/erts/emulator/sys/common/erl_mmap.c +++ b/erts/emulator/sys/common/erl_mmap.c @@ -756,7 +756,8 @@ rbt_delete(RBTree* tree, RBTNode* del) y = z; else /* Set y to z:s successor */ - for(y = z->right; y->left; y = y->left); + for(y = z->right; y->left; y = y->left) + ; /* splice out y */ x = y->left ? y->left : y->right; spliced_is_black = IS_BLACK(y); |