Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/audiomixerboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1349,9 +1349,12 @@ void CAudioMixerBoard::ApplyNewConClientList ( CVector<CChannelInfo>& vecChanInf

for ( size_t iFader = 0; iFader < iNumConnectedClients; iFader++ )
{
// ideally "iChanID" in CChannelInfo would be size_t if it can never be INVALID_INDEX

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the comment was wrong.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It includes the word if. The reason it's not size_t is because size_t is unsigned. As far as I'm aware, the comment is correct.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. We still need to have an int then until after the check.

// as assumed here
iFaderNumber[vecChanInfo[iFader].iChanID] = static_cast<int> ( iFader );
const int iChanID = vecChanInfo[iFader].iChanID;

if ( MathUtils::InRange<int> ( iChanID, 0, MAX_NUM_CHANNELS - 1 ) )
{
iFaderNumber[iChanID] = static_cast<int> ( iFader );
}
}

// Hide all unused faders and initialize used ones
Expand Down
Loading