Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(36)

Unified Diff: src/lte/model/fdtbfq-ff-mac-scheduler.cc

Issue 338840043: Eliminate Visual Studio compiler warnings (Closed)
Patch Set: Update patch with latest module changes. Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/lte/model/fdtbfq-ff-mac-scheduler.cc
===================================================================
--- a/src/lte/model/fdtbfq-ff-mac-scheduler.cc
+++ b/src/lte/model/fdtbfq-ff-mac-scheduler.cc
@@ -188,7 +188,7 @@
std::map <uint16_t,uint8_t>::iterator it = m_uesTxMode.find (params.m_rnti);
if (it == m_uesTxMode.end ())
{
- m_uesTxMode.insert (std::pair <uint16_t, double> (params.m_rnti, params.m_transmissionMode));
+ m_uesTxMode.insert (std::pair <uint16_t, uint8_t> (params.m_rnti, params.m_transmissionMode));
// generate HARQ buffers
m_dlHarqCurrentProcessId.insert (std::pair <uint16_t,uint8_t > (params.m_rnti, 0));
DlHarqProcessesStatus_t dlHarqPrcStatus;
@@ -367,6 +367,7 @@
{
NS_LOG_FUNCTION (this);
NS_FATAL_ERROR ("method not implemented");
+ NS_UNUSED (params);
return;
}
@@ -375,6 +376,7 @@
{
NS_LOG_FUNCTION (this);
NS_FATAL_ERROR ("method not implemented");
+ NS_UNUSED (params);
return;
}
@@ -536,8 +538,8 @@
RefreshDlCqiMaps ();
- int rbgSize = GetRbgSize (m_cschedCellConfig.m_dlBandwidth);
- int rbgNum = m_cschedCellConfig.m_dlBandwidth / rbgSize;
+ uint16_t rbgSize = static_cast<uint16_t> (GetRbgSize (m_cschedCellConfig.m_dlBandwidth));
+ uint16_t rbgNum = m_cschedCellConfig.m_dlBandwidth / rbgSize;
std::map <uint16_t, std::vector <uint16_t> > allocationMap; // RBs map per RNTI
std::vector <bool> rbgMap; // global RBGs map
uint16_t rbgAllocatedNum = 0;
@@ -556,8 +558,7 @@
FfMacSchedSapUser::SchedDlConfigIndParameters ret;
// update UL HARQ proc id
- std::map <uint16_t, uint8_t>::iterator itProcId;
- for (itProcId = m_ulHarqCurrentProcessId.begin (); itProcId != m_ulHarqCurrentProcessId.end (); itProcId++)
+ for (std::map <uint16_t, uint8_t>::iterator itProcId = m_ulHarqCurrentProcessId.begin (); itProcId != m_ulHarqCurrentProcessId.end (); itProcId++)
{
(*itProcId).second = ((*itProcId).second + 1) % HARQ_PROC_NUM;
}
@@ -569,9 +570,9 @@
ulRbMap = m_ffrSapProvider->GetAvailableUlRbg ();
uint8_t maxContinuousUlBandwidth = 0;
uint8_t tmpMinBandwidth = 0;
- uint16_t ffrRbStartOffset = 0;
- uint16_t tmpFfrRbStartOffset = 0;
- uint16_t index = 0;
+ uint8_t ffrRbStartOffset = 0;
+ uint8_t tmpFfrRbStartOffset = 0;
+ uint8_t index = 0;
for (std::vector<bool>::iterator it = ulRbMap.begin (); it != ulRbMap.end (); it++)
{
@@ -603,7 +604,7 @@
}
m_rachAllocationMap.resize (m_cschedCellConfig.m_ulBandwidth, 0);
- uint16_t rbStart = 0;
+ uint8_t rbStart = 0;
rbStart = ffrRbStartOffset;
std::vector <struct RachListElement_s>::iterator itRach;
for (itRach = m_rachList.begin (); itRach != m_rachList.end (); itRach++)
@@ -616,7 +617,7 @@
// UL-RACH Allocation
newRar.m_grant.m_rnti = newRar.m_rnti;
newRar.m_grant.m_mcs = m_ulGrantMcs;
- uint16_t rbLen = 1;
+ uint8_t rbLen = 1;
uint16_t tbSizeBits = 0;
// find lowest TB size that fits UL grant estimated size
while ((tbSizeBits < (*itRach).m_estimatedSize) && (rbStart + rbLen < (ffrRbStartOffset + maxContinuousUlBandwidth)))
@@ -718,7 +719,7 @@
// RNTI already allocated for retx
continue;
}
- uint8_t nLayers = m_dlInfoListBuffered.at (i).m_harqStatus.size ();
+ uint8_t nLayers = static_cast<uint8_t> (m_dlInfoListBuffered.at (i).m_harqStatus.size ());
std::vector <bool> retx;
NS_LOG_INFO (this << " Processing DLHARQ feedback");
if (nLayers == 1)
@@ -815,8 +816,8 @@
{
// find RBGs for sending HARQ retx
uint8_t j = 0;
- uint8_t rbgId = (dciRbg.at (dciRbg.size () - 1) + 1) % rbgNum;
- uint8_t startRbg = dciRbg.at (dciRbg.size () - 1);
+ uint8_t rbgId = static_cast<uint8_t> ((dciRbg.at (dciRbg.size () - 1) + 1) % rbgNum);
+ uint8_t startRbg = static_cast<uint8_t> (dciRbg.at (dciRbg.size () - 1));
std::vector <bool> rbgMapCopy = rbgMap;
while ((j < dciRbg.size ())&&(startRbg != rbgId))
{
@@ -967,13 +968,13 @@
{
if ( (*itStats).second.tokenGenerationRate / 1000 + (*itStats).second.tokenPoolSize > (*itStats).second.maxTokenPoolSize )
{
- (*itStats).second.counter += (*itStats).second.tokenGenerationRate / 1000 - ( (*itStats).second.maxTokenPoolSize - (*itStats).second.tokenPoolSize );
+ (*itStats).second.counter += static_cast<int> ((*itStats).second.tokenGenerationRate / 1000 - ( (*itStats).second.maxTokenPoolSize - (*itStats).second.tokenPoolSize ));
(*itStats).second.tokenPoolSize = (*itStats).second.maxTokenPoolSize;
bankSize += (*itStats).second.tokenGenerationRate / 1000 - ( (*itStats).second.maxTokenPoolSize - (*itStats).second.tokenPoolSize );
}
else
{
- (*itStats).second.tokenPoolSize += (*itStats).second.tokenGenerationRate / 1000;
+ (*itStats).second.tokenPoolSize += static_cast<uint32_t> ((*itStats).second.tokenGenerationRate / 1000);
}
}
@@ -1082,7 +1083,7 @@
if ( budget > (*itMax).second.burstCredit )
budget = (*itMax).second.burstCredit;
if ( budget > bankSize )
- budget = bankSize;
+ budget = static_cast<uint32_t> (bankSize);
}
budget = budget + (*itMax).second.tokenPoolSize;
@@ -1114,7 +1115,7 @@
// assign RBGs to this UE
uint32_t bytesTxed = 0;
uint32_t bytesTxedTmp = 0;
- int rbgIndex = 0;
+ uint16_t rbgIndex = 0;
while ( bytesTxed <= budget )
{
totalRbg++;
@@ -1132,7 +1133,7 @@
// find RBG with largest achievableRate
double achievableRateMax = 0.0;
rbgIndex = rbgNum;
- for (int k = 0; k < rbgNum; k++)
+ for (uint8_t k = 0; k < rbgNum; k++)
{
std::set <uint8_t>::iterator rbg;
rbg = allocatedRbg.find (k);
@@ -1148,7 +1149,7 @@
std::vector <uint8_t> sbCqi;
if (itCqi == m_a30CqiRxed.end ())
{
- for (uint8_t k = 0; k < nLayer; k++)
+ for (uint8_t l = 0; l < nLayer; l++)
{
sbCqi.push_back (1); // start with lowest value
}
@@ -1203,7 +1204,7 @@
else
{
// mark this UE as "allocated"
- allocatedRbg.insert (rbgIndex);
+ allocatedRbg.insert (static_cast<uint8_t> (rbgIndex));
}
// assign this RBG to UE
@@ -1224,7 +1225,7 @@
}
rbgMap.at (rbgIndex) = true; // Mark this RBG as allocated
- RbgPerRnti = (*itMap).second.size();
+ RbgPerRnti = static_cast<uint16_t> ((*itMap).second.size());
// calculate tb size
std::vector <uint8_t> worstCqi (2, 15);
@@ -1283,7 +1284,7 @@
std::map <uint16_t, std::vector <uint16_t> >::iterator itMap;
itMap = allocationMap.find ((*itMax).first);
(*itMap).second.pop_back ();
- allocatedRbg.erase (rbgIndex);
+ allocatedRbg.erase (static_cast<uint8_t> (rbgIndex));
bytesTxed = bytesTxedTmp; // recovery bytesTxed
totalRbg--;
rbgMap.at (rbgIndex) = false; // unmark this RBG
@@ -1318,14 +1319,14 @@
newDci.m_rnti = (*itMap).first;
newDci.m_harqProcess = UpdateHarqProcessId ((*itMap).first);
- uint16_t lcActives = LcActivePerFlow ((*itMap).first);
+ uint16_t lcActives = static_cast<uint16_t> (LcActivePerFlow ((*itMap).first));
NS_LOG_INFO (this << "Allocate user " << newEl.m_rnti << " rbg " << lcActives);
if (lcActives == 0)
{
// Set to max value, to avoid divide by 0 below
lcActives = (uint16_t)65535; // UINT16_MAX;
}
- uint16_t RgbPerRnti = (*itMap).second.size ();
+ uint16_t RgbPerRnti = static_cast<uint16_t> ((*itMap).second.size ());
std::map <uint16_t,SbMeasResult_s>::iterator itCqi;
itCqi = m_a30CqiRxed.find ((*itMap).first);
std::map <uint16_t,uint8_t>::iterator itTxMode;
@@ -1384,7 +1385,7 @@
{
newDci.m_mcs.push_back (m_amc->GetMcsFromCqi (worstCqi.at (j)));
int tbSize = (m_amc->GetDlTbSizeFromMcs (newDci.m_mcs.at (j), RgbPerRnti * rbgSize) / 8); // (size of TB in bytes according to table 7.1.7.2.1-1 of 36.213)
- newDci.m_tbsSize.push_back (tbSize);
+ newDci.m_tbsSize.push_back (static_cast<uint16_t> (tbSize));
NS_LOG_INFO (this << " Layer " << (uint16_t)j << " MCS selected" << m_amc->GetMcsFromCqi (worstCqi.at (j)));
bytesTxed += tbSize;
}
@@ -1613,7 +1614,7 @@
}
uint8_t minContinuousUlBandwidth = m_ffrSapProvider->GetMinContinuousUlBandwidth ();
- uint8_t ffrUlBandwidth = m_cschedCellConfig.m_ulBandwidth - rbAllocatedNum;
+ uint8_t ffrUlBandwidth = static_cast<uint8_t> (m_cschedCellConfig.m_ulBandwidth - rbAllocatedNum);
// remove RACH allocation
for (uint16_t i = 0; i < m_cschedCellConfig.m_ulBandwidth; i++)
@@ -1726,14 +1727,14 @@
// Divide the remaining resources equally among the active users starting from the subsequent one served last scheduling trigger
- uint16_t tempRbPerFlow = (ffrUlBandwidth) / (nflows + rntiAllocated.size ());
+ uint16_t tempRbPerFlow = static_cast<uint16_t> ((ffrUlBandwidth) / (nflows + rntiAllocated.size ()));
uint16_t rbPerFlow = (minContinuousUlBandwidth < tempRbPerFlow) ? minContinuousUlBandwidth : tempRbPerFlow;
if (rbPerFlow < 3)
{
rbPerFlow = 3; // at least 3 rbg per flow (till available resource) to ensure TxOpportunity >= 7 bytes
}
- int rbAllocated = 0;
+ uint16_t rbAllocated = 0;
std::map <uint16_t, fdtbfqsFlowPerf_t>::iterator itStats;
if (m_nextRntiUl != 0)
@@ -1785,7 +1786,8 @@
rbAllocated = 0;
UlDciListElement_s uldci;
uldci.m_rnti = (*it).first;
- uldci.m_rbLen = rbPerFlow;
+ uldci.m_rbLen = static_cast<uint8_t> (rbPerFlow);
+ uldci.m_rbStart = 0;
bool allocated = false;
NS_LOG_INFO (this << " RB Allocated " << rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows);
while ((!allocated)&&((rbAllocated + rbPerFlow - m_cschedCellConfig.m_ulBandwidth) < 1) && (rbPerFlow != 0))
@@ -1808,7 +1810,7 @@
if (free)
{
NS_LOG_INFO (this << "RNTI: "<< (*it).first<< " RB Allocated " << rbAllocated << " rbPerFlow " << rbPerFlow << " flows " << nflows);
- uldci.m_rbStart = rbAllocated;
+ uldci.m_rbStart = static_cast<uint8_t> (rbAllocated);
for (uint16_t j = rbAllocated; j < rbAllocated + rbPerFlow; j++)
{
@@ -1969,6 +1971,7 @@
FdTbfqFfMacScheduler::DoSchedUlNoiseInterferenceReq (const struct FfMacSchedSapProvider::SchedUlNoiseInterferenceReqParameters& params)
{
NS_LOG_FUNCTION (this);
+ NS_UNUSED (params);
return;
}
@@ -1976,6 +1979,7 @@
FdTbfqFfMacScheduler::DoSchedUlSrInfoReq (const struct FfMacSchedSapProvider::SchedUlSrInfoReqParameters& params)
{
NS_LOG_FUNCTION (this);
+ NS_UNUSED (params);
return;
}

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b