From 7ef084e4c6d84f5bbf3bd38dcf95979efda3a188 Mon Sep 17 00:00:00 2001 From: James Cherry Date: Thu, 14 Nov 2024 10:53:20 -0800 Subject: [PATCH] c++20, 23 compatibility Signed-off-by: James Cherry --- dcalc/DmpCeff.cc | 2 +- search/Bfs.cc | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dcalc/DmpCeff.cc b/dcalc/DmpCeff.cc index c00f85aa..0d3c8e91 100644 --- a/dcalc/DmpCeff.cc +++ b/dcalc/DmpCeff.cc @@ -1516,7 +1516,7 @@ DmpCeffDelayCalc::gateDelay(const Pin *drvr_pin, dcalc_result.setGateDelay(gate_delay); dcalc_result.setDrvrSlew(drvr_slew); - for (const auto [load_pin, load_idx] : load_pin_index_map) { + for (const auto &[load_pin, load_idx] : load_pin_index_map) { ArcDelay wire_delay; Slew load_slew; loadDelaySlew(load_pin, drvr_slew, rf, drvr_library, parasitic, diff --git a/search/Bfs.cc b/search/Bfs.cc index 62d26196..eced2dd3 100644 --- a/search/Bfs.cc +++ b/search/Bfs.cc @@ -190,14 +190,15 @@ BfsIterator::visitParallel(Level to_level, else { size_t from = 0; size_t chunk_size = vertex_count / thread_count; + BfsIndex bfs_index = bfs_index_; for (size_t k = 0; k < thread_count; k++) { // Last thread gets the left overs. size_t to = (k == thread_count - 1) ? vertex_count : from + chunk_size; - dispatch_queue_->dispatch( [&](int) { + dispatch_queue_->dispatch( [=](int) { for (size_t i = from; i < to; i++) { Vertex *vertex = level_vertices[i]; if (vertex) { - vertex->setBfsInQueue(bfs_index_, false); + vertex->setBfsInQueue(bfs_index, false); visitors[k]->visit(vertex); } }