diff options
| author | Tyge Løvset <[email protected]> | 2022-04-11 00:04:01 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2022-04-11 00:04:01 +0200 |
| commit | 99acd2149f3f8996249b3ef82f7490dd098783d7 (patch) | |
| tree | 967ff19c6e06de13aeb76f0f88318846f15623f8 /include/stc/cpque.h | |
| parent | 2e781ef2c6956d9b4e11f08bdd23477c3b34ee2f (diff) | |
| download | STC-modified-99acd2149f3f8996249b3ef82f7490dd098783d7.tar.gz STC-modified-99acd2149f3f8996249b3ef82f7490dd098783d7.zip | |
Added important parenthesizes around macro expressions.
Diffstat (limited to 'include/stc/cpque.h')
| -rw-r--r-- | include/stc/cpque.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/stc/cpque.h b/include/stc/cpque.h index 3a4528ec..1b247a9f 100644 --- a/include/stc/cpque.h +++ b/include/stc/cpque.h @@ -110,8 +110,8 @@ STC_INLINE void _cx_memb(_emplace)(_cx_self* self, _cx_raw raw) STC_DEF void
_cx_memb(_sift_down_)(_cx_value* arr, const size_t idx, const size_t n) {
for (size_t r = idx, c = idx << 1; c <= n; c <<= 1) {
- c += (c < n && i_cmp((&arr[c]), (&arr[c + 1])) < 0);
- if (i_cmp((&arr[r]), (&arr[c])) >= 0) return;
+ c += (c < n && (i_cmp((&arr[c]), (&arr[c + 1]))) < 0);
+ if ((i_cmp((&arr[r]), (&arr[c]))) >= 0) return;
_cx_value t = arr[r]; arr[r] = arr[c]; arr[r = c] = t;
}
}
@@ -148,7 +148,7 @@ _cx_memb(_push)(_cx_self* self, _cx_value value) { _cx_memb(_reserve)(self, self->size*3/2 + 4);
_cx_value *arr = self->data - 1; /* base 1 */
size_t c = ++self->size;
- for (; c > 1 && i_cmp((&arr[c >> 1]), (&value)) < 0; c >>= 1)
+ for (; c > 1 && (i_cmp((&arr[c >> 1]), (&value))) < 0; c >>= 1)
arr[c] = arr[c >> 1];
arr[c] = value;
}
|
