From 50ff394cc8743d1eaa02445129d8d8a99f8abc65 Mon Sep 17 00:00:00 2001 From: Jan Wassenberg Date: Fri, 7 Feb 2025 04:53:19 -0800 Subject: [PATCH] warning fixes (casts), use line instead of __LINE__ PiperOrigin-RevId: 724302292 --- hwy/contrib/thread_pool/topology.cc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hwy/contrib/thread_pool/topology.cc b/hwy/contrib/thread_pool/topology.cc index 9a00a6fad2..4176f33b2c 100644 --- a/hwy/contrib/thread_pool/topology.cc +++ b/hwy/contrib/thread_pool/topology.cc @@ -162,9 +162,8 @@ void ForeachBit(size_t num_groups, const GROUP_AFFINITY* affinity, size_t lp = Num0BitsBelowLS1Bit_Nonzero64(bits); bits &= bits - 1; // clear LSB if (HWY_UNLIKELY(lp >= lps.size())) { - Warn(__FILE__, __LINE__, - "Clamping lp %zu to lps.size() %zu, groups %zu\n", lp, lps.size(), - num_groups); + Warn(__FILE__, line, "Clamping lp %zu to lps.size() %zu, groups %zu\n", + lp, lps.size(), num_groups); lp = lps.size() - 1; } func(lp, lps); @@ -676,8 +675,8 @@ size_t MaxLpsPerCore(std::vector& lps) { size_t smt = 0; ForeachBit(p.GroupCount, p.GroupMask, lps, __LINE__, [core_idx, &smt](size_t lp, std::vector& lps) { - lps[lp].core = core_idx; - lps[lp].smt = smt++; + lps[lp].core = static_cast(core_idx); + lps[lp].smt = static_cast(smt++); }); ++core_idx; }); @@ -702,7 +701,7 @@ size_t MaxCoresPerCluster(const size_t max_lps_per_core, ForeachBit(num_groups, groups, lps, __LINE__, [cluster_idx](size_t lp, std::vector& lps) { - lps[lp].cluster = cluster_idx; + lps[lp].cluster = static_cast(cluster_idx); }); ++cluster_idx; }; @@ -750,7 +749,7 @@ std::vector DetectPackages(std::vector& lps) { ForeachBit(p.GroupCount, p.GroupMask, lps, __LINE__, [package_idx](size_t lp, std::vector& lps) { - lps[lp].package = package_idx; + lps[lp].package = static_cast(package_idx); }); ++package_idx; });