From cdc8eb7ad393c049d3fdf520c6fd1475d33c3a73 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 10 Feb 2025 12:56:29 -0500 Subject: Fully parenthesize expressions --- src/errno_status.c | 2 +- src/hash.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/errno_status.c b/src/errno_status.c index d992d02..ed09b24 100644 --- a/src/errno_status.c +++ b/src/errno_status.c @@ -41,7 +41,7 @@ zix_errno_status(const int e) {0, ZIX_STATUS_ERROR}, // Fallback mapping }; - static const size_t n_mappings = sizeof(map) / sizeof(Mapping) - 1U; + static const size_t n_mappings = (sizeof(map) / sizeof(Mapping)) - 1U; // Find the index of the matching mapping (or leave it at the fallback entry) size_t m = 0; diff --git a/src/hash.c b/src/hash.c index 3c0e47c..6c98bcf 100644 --- a/src/hash.c +++ b/src/hash.c @@ -330,7 +330,7 @@ zix_hash_insert_at(ZixHash* const hash, entry->value = record; // Update size and rehash if we exceeded the maximum load - const size_t max_load = hash->n_entries / 2U + hash->n_entries / 8U; + const size_t max_load = (hash->n_entries / 2U) + (hash->n_entries / 8U); const size_t new_count = hash->count + 1U; if (new_count >= max_load) { const ZixStatus st = grow(hash); -- cgit v1.2.1