From eabd000a54bb1d199ef834e6d4514a793b52468b Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 4 Jan 2026 18:12:08 +0200 Subject: [PATCH] Avoid -Wconversion, -Wsign-conversion warnings in detail/basic_name_generator.hpp under GCC 9 and below --- include/boost/uuid/detail/basic_name_generator.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/boost/uuid/detail/basic_name_generator.hpp b/include/boost/uuid/detail/basic_name_generator.hpp index c97e037..40773b7 100644 --- a/include/boost/uuid/detail/basic_name_generator.hpp +++ b/include/boost/uuid/detail/basic_name_generator.hpp @@ -121,8 +121,8 @@ private: { char16_t ch2 = p[ ++i ]; - std::uint32_t high = ch - 0xD800; - std::uint32_t low = ch2 - 0xDC00; + std::uint32_t high = static_cast( ch - 0xD800 ); + std::uint32_t low = static_cast( ch2 - 0xDC00 ); process_utf32_codepoint( hash, ( high << 10 ) + low + 0x10000 ); } @@ -204,8 +204,8 @@ private: // set version unsigned char hashver = hash.get_version(); - *(u.begin()+6) &= 0x0F; // clear out the relevant bits - *(u.begin()+6) |= (hashver << 4); // and apply them + *(u.begin()+6) &= 0x0F; // clear out the relevant bits + *(u.begin()+6) |= static_cast(hashver << 4); // and apply them return u; }