Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix range-loop-construct warnings (#1089)
This patch fixes the following warnings reported by g++ (GCC) 11 P4Objects.cpp:656:21: warning: loop variable 'cfg_field' creates a copy from type 'const Json::Value' [-Wrange-loop-construct] 656 | for (const auto cfg_field : cfg_fields) { | ^~~~~~~~~ P4Objects.cpp:656:21: note: use reference type to prevent copying 656 | for (const auto cfg_field : cfg_fields) { | ^~~~~~~~~ | & simple_pre.cpp:187:19: warning: loop variable 'p' creates a copy from type 'const std::pair<const long unsigned int, bm::McSimplePre::MgidEntry>' [-Wrange-loop-construct] 187 | for (const auto p : mgid_entries) { | ^ simple_pre.cpp:187:19: note: use reference type to prevent copying 187 | for (const auto p : mgid_entries) { | ^ | & simple_pre.cpp:215:19: warning: loop variable 'p' creates a copy from type 'const std::pair<const long unsigned int, bm::McSimplePre::L2Entry>' [-Wrange-loop-construct] 215 | for (const auto p : l2_entries) { | ^ simple_pre.cpp:215:19: note: use reference type to prevent copying 215 | for (const auto p : l2_entries) { | ^ | & Signed-off-by: Radostin Stoyanov <[email protected]>
- Loading branch information