From 5dce4fefca3d4ae8eb72823f8c811a4b4acf6fa5 Mon Sep 17 00:00:00 2001 From: Stanislav Paskalev Date: Sat, 15 Jun 2024 02:57:08 +0300 Subject: [PATCH] Fix a harmless precision warning by msvc (#111) --- buddy_alloc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buddy_alloc.h b/buddy_alloc.h index b42c4c4..c22ffa4 100644 --- a/buddy_alloc.h +++ b/buddy_alloc.h @@ -1752,8 +1752,8 @@ unsigned int buddy_tree_check_invariant(struct buddy_tree *t, struct buddy_tree_ * Based on https://asawicki.info/news_1757_a_metric_for_memory_fragmentation */ static unsigned char buddy_tree_fragmentation(struct buddy_tree *t) { - const size_t fractional_bits = 8; - const size_t fractional_mask = 255; + const unsigned char fractional_bits = 8; + const unsigned char fractional_mask = 255; uint8_t tree_order; size_t root_status, quality, total_free_size, virtual_size, quality_percent;