mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 09:32:01 +00:00
Fix -Wshorten-64-to-32 for musl
On musl uint_fast32_t is uint32_t, while for glibc it is unsigned long long. Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
parent
4e76629aaf
commit
089bf39132
@ -353,7 +353,7 @@ struct PoolWithFailoverBase<TNestedPool>::PoolState
|
||||
}
|
||||
|
||||
private:
|
||||
std::minstd_rand rng = std::minstd_rand(randomSeed());
|
||||
std::minstd_rand rng = std::minstd_rand(static_cast<uint_fast32_t>(randomSeed()));
|
||||
};
|
||||
|
||||
template <typename TNestedPool>
|
||||
|
@ -42,8 +42,8 @@ PoolWithFailover::PoolWithFailover(
|
||||
/// which triggers massive re-constructing of connection pools.
|
||||
/// The state of PRNGs like std::mt19937 is considered to be quite heavy
|
||||
/// thus here we attempt to optimize its construction.
|
||||
static thread_local std::mt19937 rnd_generator(
|
||||
std::hash<std::thread::id>{}(std::this_thread::get_id()) + std::clock());
|
||||
static thread_local std::mt19937 rnd_generator(static_cast<uint_fast32_t>(
|
||||
std::hash<std::thread::id>{}(std::this_thread::get_id()) + std::clock()));
|
||||
for (auto & [_, replicas] : replicas_by_priority)
|
||||
{
|
||||
if (replicas.size() > 1)
|
||||
|
Loading…
Reference in New Issue
Block a user