Skip to content

Commit

Permalink
Calc numTracks outside of the loop
Browse files Browse the repository at this point in the history
Co-authored-by: Swiftb0y <[email protected]>
  • Loading branch information
daschuer and Swiftb0y committed Jan 3, 2025
1 parent c89f06e commit b47a282
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/coreservices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,9 +441,8 @@ void CoreServices::initialize(QApplication* pApp) {
// Load tracks in args.qlMusicFiles (command line arguments) into player
// 1 and 2:
const QList<QString>& musicFiles = m_cmdlineArgs.getMusicFiles();
for (int i = 0; i < m_pPlayerManager->numberOfDecks() &&
i < musicFiles.count();
++i) {
const int numTracks = std::min(m_pPlayerManager->numberOfDecks(), musicFiles.count());

Check failure on line 444 in src/coreservices.cpp

View workflow job for this annotation

GitHub Actions / clazy

no matching function for call to 'min'

Check failure on line 444 in src/coreservices.cpp

View workflow job for this annotation

GitHub Actions / Ubuntu 22.04

no matching function for call to ‘min(int, qsizetype)’

Check failure on line 444 in src/coreservices.cpp

View workflow job for this annotation

GitHub Actions / clang-tidy

no matching function for call to 'min' [clang-diagnostic-error]

Check failure on line 444 in src/coreservices.cpp

View workflow job for this annotation

GitHub Actions / macOS 13 x64

no matching function for call to 'min'

Check failure on line 444 in src/coreservices.cpp

View workflow job for this annotation

GitHub Actions / coverage

no matching function for call to ‘min(int, qsizetype)’

Check failure on line 444 in src/coreservices.cpp

View workflow job for this annotation

GitHub Actions / macOS 13 arm64

no matching function for call to 'min'

Check failure on line 444 in src/coreservices.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

'std::min': no matching overloaded function found

Check failure on line 444 in src/coreservices.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

'_Ty std::min(std::initializer_list<_Elem>)': expects 1 arguments - 2 provided

Check failure on line 444 in src/coreservices.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

'_Ty std::min(std::initializer_list<_Elem>,_Pr)': could not deduce template argument for 'std::initializer_list<_Elem>' from 'int'

Check failure on line 444 in src/coreservices.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

'const _Ty &std::min(const _Ty &,const _Ty &) noexcept(<expr>)': template parameter '_Ty' is ambiguous

Check failure on line 444 in src/coreservices.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

'const _Ty &std::min(const _Ty &,const _Ty &) noexcept(<expr>)': could not deduce template argument for 'const _Ty &' from 'qsizetype'

Check failure on line 444 in src/coreservices.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

'const _Ty &std::min(const _Ty &,const _Ty &,_Pr) noexcept(<expr>)': expects 3 arguments - 2 provided

Check failure on line 444 in src/coreservices.cpp

View workflow job for this annotation

GitHub Actions / Windows 2019 (MSVC)

'numTracks': const object must be initialized
for (int i = 0; i < numTracks; ++i) {
if (SoundSourceProxy::isFileNameSupported(musicFiles.at(i))) {
m_pPlayerManager->slotLoadToDeck(musicFiles.at(i), i + 1);
}
Expand Down

0 comments on commit b47a282

Please sign in to comment.