From 699fb9de85f175c32c6bcbe21078d5ef42a458c0 Mon Sep 17 00:00:00 2001 From: Sam Van Gysegem Date: Wed, 30 Oct 2024 21:50:39 +0100 Subject: [PATCH] fix: base extent relies on size of T and not std::uint32_t Signed-off-by: Sam Van Gysegem --- include/msg/field.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/msg/field.hpp b/include/msg/field.hpp index 4ea8d070..4ee6c2bc 100644 --- a/include/msg/field.hpp +++ b/include/msg/field.hpp @@ -215,7 +215,7 @@ struct bits_locator_t { template constexpr static auto extent_in() -> std::size_t { constexpr auto msb = Lsb + BitSize - 1; constexpr auto msb_extent = (msb + CHAR_BIT - 1) / CHAR_BIT; - constexpr auto base_extent = Index * sizeof(std::uint32_t); + constexpr auto base_extent = Index * sizeof(T); constexpr auto extent = base_extent + msb_extent; return (extent + sizeof(T) - 1) / sizeof(T); }