Skip to content

Commit

Permalink
Renaming divisersSet to diviserSet
Browse files Browse the repository at this point in the history
  • Loading branch information
LeStarch committed Oct 26, 2023
1 parent 2766808 commit 436912b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Svc/RateGroupDriver/RateGroupDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,26 @@ namespace Svc {

}

void RateGroupDriver::configure(const DividerSet& dividersSet)
void RateGroupDriver::configure(const DividerSet& dividerSet)

Check notice

Code scanning / CodeQL

Long function without assertion Note

All functions of more than 10 lines should have at least one assertion.
{

// check arguments
FW_ASSERT(dividersSet.dividers);
FW_ASSERT(dividerSet.dividers);
// verify port/table size matches
FW_ASSERT(FW_NUM_ARRAY_ELEMENTS(this->m_dividers) == this->getNum_CycleOut_OutputPorts(),
static_cast<NATIVE_INT_TYPE>(FW_NUM_ARRAY_ELEMENTS(this->m_dividers)),
this->getNum_CycleOut_OutputPorts());
// copy provided array of dividers
for (NATIVE_UINT_TYPE entry = 0; entry < RateGroupDriver::DIVIDER_SIZE; entry++) {

Check notice

Code scanning / CodeQL

Use of basic integral type Note

entry uses the basic integral type unsigned int rather than a typedef with size and signedness.
// A port with an offset equal or bigger than the divisor is not accepted because it would never be called
FW_ASSERT((dividersSet.dividers[entry].offset==0)||(dividersSet.dividers[entry].offset < dividersSet.dividers[entry].divisor),
dividersSet.dividers[entry].offset,
dividersSet.dividers[entry].divisor);
this->m_dividers[entry] = dividersSet.dividers[entry];
FW_ASSERT((dividerSet.dividers[entry].offset==0)||(dividerSet.dividers[entry].offset < dividerSet.dividers[entry].divisor),
dividerSet.dividers[entry].offset,
dividerSet.dividers[entry].divisor);
this->m_dividers[entry] = dividerSet.dividers[entry];
// rollover value should be product of all dividers to make sure integer rollover doesn't jump cycles
// only use non-zero dividers
if (dividersSet.dividers[entry].divisor != 0) {
this->m_rollover *= dividersSet.dividers[entry].divisor;
if (dividerSet.dividers[entry].divisor != 0) {
this->m_rollover *= dividerSet.dividers[entry].divisor;
}
}
this->m_configured = true;
Expand Down

0 comments on commit 436912b

Please sign in to comment.