From c11a5cc2c8e9c2a05bf136cdc4f355319a6c0347 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Mon, 5 Jul 2021 10:54:48 +0200 Subject: [PATCH] Walk around GCC 4.8 compilation --- CMakeLists.txt | 4 ++-- test/phy/dummy_gnb_stack.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a5cae6c3f..25878d16d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -509,8 +509,8 @@ endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # Add colored output when using the Ninja generator if("Ninja" STREQUAL ${CMAKE_GENERATOR}) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always") + ADD_C_COMPILER_FLAG_IF_AVAILABLE("-fdiagnostics-color=always" HAVE_DIAGNOSTIC_COLOR_C) + ADD_CXX_COMPILER_FLAG_IF_AVAILABLE("-fdiagnostics-color=always" HAVE_DIAGNOSTIC_COLOR_CXX) endif() # Add -Werror to C/C++ flags for newer compilers diff --git a/test/phy/dummy_gnb_stack.h b/test/phy/dummy_gnb_stack.h index e8837b39d..42c2d9c5d 100644 --- a/test/phy/dummy_gnb_stack.h +++ b/test/phy/dummy_gnb_stack.h @@ -77,7 +77,7 @@ private: return ack.cc[0].M % 4; } }; - srsran::circular_array pending_ack = {}; + std::array pending_ack = {}; struct dummy_harq_proc { static const uint32_t MAX_TB_SZ = SRSRAN_LDPC_MAX_LEN_CB * SRSRAN_SCH_NR_MAX_NOF_CB_LDPC; @@ -218,7 +218,7 @@ public: dci.rv = 0; dci.ndi = (slot_cfg.idx / SRSRAN_NOF_SF_X_FRAME) % 2; dci.pid = slot_cfg.idx % SRSRAN_NOF_SF_X_FRAME; - dci.dai = pending_ack[harq_ack_slot_idx].get_dai(); + dci.dai = pending_ack[harq_ack_slot_idx % pending_ack.size()].get_dai(); dci.tpc = 1; dci.pucch_resource = 0; if (dci.ctx.format == srsran_dci_format_nr_1_0) { @@ -254,7 +254,7 @@ public: } // Calculate PUCCH slot and push resource - pending_ack[harq_ack_slot_idx].push_ack(ack_resource); + pending_ack[harq_ack_slot_idx % pending_ack.size()].push_ack(ack_resource); return SRSRAN_SUCCESS; } @@ -263,7 +263,7 @@ public: { logger.set_context(slot_cfg.idx); - srsran_pdsch_ack_nr_t ack = pending_ack[slot_cfg.idx].get_ack(); + srsran_pdsch_ack_nr_t ack = pending_ack[slot_cfg.idx % pending_ack.size()].get_ack(); if (ack.nof_cc > 0) { mac_interface_phy_nr::pucch_t pucch = {};