diff options
Diffstat (limited to 'utils')
-rw-r--r-- | utils/alsoft-config/mainwindow.cpp | 32 | ||||
-rw-r--r-- | utils/makemhr/makemhr.cpp | 2 | ||||
-rw-r--r-- | utils/uhjencoder.cpp | 4 |
3 files changed, 19 insertions, 19 deletions
diff --git a/utils/alsoft-config/mainwindow.cpp b/utils/alsoft-config/mainwindow.cpp index eb4458b2..39b773af 100644 --- a/utils/alsoft-config/mainwindow.cpp +++ b/utils/alsoft-config/mainwindow.cpp @@ -21,7 +21,7 @@ namespace { -static const struct { +const struct { char backend_name[16]; char full_string[32]; } backendList[] = { @@ -75,7 +75,7 @@ static const struct { { "", "" } }; -static const struct NameValuePair { +const struct NameValuePair { const char name[64]; const char value[16]; } speakerModeList[] = { @@ -146,7 +146,7 @@ static const struct NameValuePair { { "", "" } }; -static QString getDefaultConfigName() +QString getDefaultConfigName() { #ifdef Q_OS_WIN32 static const char fname[] = "alsoft.ini"; @@ -173,7 +173,7 @@ static QString getDefaultConfigName() return fname; } -static QString getBaseDataPath() +QString getBaseDataPath() { #ifdef Q_OS_WIN32 auto get_appdata_path = []() noexcept -> QString @@ -196,7 +196,7 @@ static QString getBaseDataPath() return base; } -static QStringList getAllDataPaths(const QString &append) +QStringList getAllDataPaths(const QString &append) { QStringList list; list.append(getBaseDataPath()); @@ -227,7 +227,7 @@ static QStringList getAllDataPaths(const QString &append) } template<size_t N> -static QString getValueFromName(const NameValuePair (&list)[N], const QString &str) +QString getValueFromName(const NameValuePair (&list)[N], const QString &str) { for(size_t i = 0;i < N-1;i++) { @@ -238,7 +238,7 @@ static QString getValueFromName(const NameValuePair (&list)[N], const QString &s } template<size_t N> -static QString getNameFromValue(const NameValuePair (&list)[N], const QString &str) +QString getNameFromValue(const NameValuePair (&list)[N], const QString &str) { for(size_t i = 0;i < N-1;i++) { @@ -844,7 +844,7 @@ void MainWindow::loadConfig(const QString &fname) ui->enabledBackendList->clear(); ui->disabledBackendList->clear(); QStringList drivers{settings.value("drivers").toStringList()}; - if(drivers.size() == 0) + if(drivers.empty()) ui->backendCheckBox->setChecked(true); else { @@ -1091,7 +1091,7 @@ void MainWindow::saveConfig(const QString &fname) const } } } - if(strlist.size() == 0 && !ui->backendCheckBox->isChecked()) + if(strlist.empty() && !ui->backendCheckBox->isChecked()) strlist.append("-all"); else if(ui->backendCheckBox->isChecked()) strlist.append(QString{}); @@ -1322,7 +1322,7 @@ void MainWindow::removeHrtfFile() void MainWindow::updateHrtfRemoveButton() { - ui->hrtfRemoveButton->setEnabled(ui->hrtfFileList->selectedItems().size() != 0); + ui->hrtfRemoveButton->setEnabled(!ui->hrtfFileList->selectedItems().empty()); } void MainWindow::showEnabledBackendMenu(QPoint pt) @@ -1333,7 +1333,7 @@ void MainWindow::showEnabledBackendMenu(QPoint pt) QMenu ctxmenu; QAction *removeAction{ctxmenu.addAction(QIcon::fromTheme("list-remove"), "Remove")}; - if(ui->enabledBackendList->selectedItems().size() == 0) + if(ui->enabledBackendList->selectedItems().empty()) removeAction->setEnabled(false); ctxmenu.addSeparator(); for(size_t i = 0;backendList[i].backend_name[0];i++) @@ -1341,8 +1341,8 @@ void MainWindow::showEnabledBackendMenu(QPoint pt) QString backend{backendList[i].full_string}; QAction *action{ctxmenu.addAction(QString("Add ")+backend)}; actionMap[action] = backend; - if(ui->enabledBackendList->findItems(backend, Qt::MatchFixedString).size() != 0 || - ui->disabledBackendList->findItems(backend, Qt::MatchFixedString).size() != 0) + if(!ui->enabledBackendList->findItems(backend, Qt::MatchFixedString).empty() || + !ui->disabledBackendList->findItems(backend, Qt::MatchFixedString).empty()) action->setEnabled(false); } @@ -1371,7 +1371,7 @@ void MainWindow::showDisabledBackendMenu(QPoint pt) QMenu ctxmenu; QAction *removeAction{ctxmenu.addAction(QIcon::fromTheme("list-remove"), "Remove")}; - if(ui->disabledBackendList->selectedItems().size() == 0) + if(ui->disabledBackendList->selectedItems().empty()) removeAction->setEnabled(false); ctxmenu.addSeparator(); for(size_t i = 0;backendList[i].backend_name[0];i++) @@ -1379,8 +1379,8 @@ void MainWindow::showDisabledBackendMenu(QPoint pt) QString backend{backendList[i].full_string}; QAction *action{ctxmenu.addAction(QString("Add ")+backend)}; actionMap[action] = backend; - if(ui->disabledBackendList->findItems(backend, Qt::MatchFixedString).size() != 0 || - ui->enabledBackendList->findItems(backend, Qt::MatchFixedString).size() != 0) + if(!ui->disabledBackendList->findItems(backend, Qt::MatchFixedString).empty() || + !ui->enabledBackendList->findItems(backend, Qt::MatchFixedString).empty()) action->setEnabled(false); } diff --git a/utils/makemhr/makemhr.cpp b/utils/makemhr/makemhr.cpp index e0911438..e3585530 100644 --- a/utils/makemhr/makemhr.cpp +++ b/utils/makemhr/makemhr.cpp @@ -1024,7 +1024,7 @@ static void NormalizeHrirs(HrirDataT *hData) /* Now scale all IRs by the given factor. */ auto proc_channel = [irSize,factor](double *ir) - { std::transform(ir, ir+irSize, ir, std::bind(std::multiplies<double>{}, _1, factor)); }; + { std::transform(ir, ir+irSize, ir, [factor](auto a){ return a * factor; }}; auto proc_azi = [channels,proc_channel](HrirAzT &azi) { std::for_each(azi.mIrs, azi.mIrs+channels, proc_channel); }; auto proc_elev = [proc_azi](HrirEvT &elev) diff --git a/utils/uhjencoder.cpp b/utils/uhjencoder.cpp index 9af1b3cf..34698993 100644 --- a/utils/uhjencoder.cpp +++ b/utils/uhjencoder.cpp @@ -349,7 +349,7 @@ int main(int argc, char **argv) else { std::string mapstr; - if(chanmap.size() > 0) + if(!chanmap.empty()) { mapstr = std::to_string(chanmap[0]); for(int idx : al::span<int>{chanmap}.subspan<1>()) @@ -414,7 +414,7 @@ int main(int argc, char **argv) auto encoder = std::make_unique<UhjEncoder>(); auto splbuf = al::vector<FloatBufferLine, 16>(static_cast<uint>(9+ininfo.channels)+uhjchans); - auto ambmem = al::span<FloatBufferLine,4>{&splbuf[0], 4}; + auto ambmem = al::span<FloatBufferLine,4>{splbuf.data(), 4}; auto encmem = al::span<FloatBufferLine,4>{&splbuf[4], 4}; auto srcmem = al::span<float,BufferLineSize>{splbuf[8].data(), BufferLineSize}; auto outmem = al::span<float>{splbuf[9].data(), BufferLineSize*uhjchans}; |