2
0
mirror of https://github.com/boostorg/uuid.git synced 2026-01-19 04:42:16 +00:00

Avoid -Wconversion, -Wsign-conversion warnings in detail/basic_name_generator.hpp under GCC 9 and below

This commit is contained in:
Peter Dimov
2026-01-04 18:12:08 +02:00
parent 520b3632f3
commit eabd000a54

View File

@@ -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<std::uint32_t>( ch - 0xD800 );
std::uint32_t low = static_cast<std::uint32_t>( 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<unsigned char>(hashver << 4); // and apply them
return u;
}