From a9e6d9f4c0b6a841a975b21e0fbad303502f6269 Mon Sep 17 00:00:00 2001 From: ibat10clw Date: Mon, 10 Mar 2025 14:31:41 +0800 Subject: [PATCH] Fix magic number in bucket declaration Replace hard-coded value with BUCKET_SIZE macro for better readability. Change-Id: I4b123b7267dcb9beac8d791fd1e7cb9b75a6b446 --- shannon_entropy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shannon_entropy.c b/shannon_entropy.c index 1c6b17864..1b7b61643 100644 --- a/shannon_entropy.c +++ b/shannon_entropy.c @@ -15,7 +15,7 @@ double shannon_entropy(const uint8_t *s) uint64_t entropy_sum = 0; const uint64_t entropy_max = 8 * LOG2_RET_SHIFT; - uint32_t bucket[256]; + uint32_t bucket[BUCKET_SIZE]; memset(&bucket, 0, sizeof(bucket)); for (uint32_t i = 0; i < count; i++)