diff options
author | Chris Robinson <[email protected]> | 2023-12-04 23:38:31 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-12-04 23:38:31 -0800 |
commit | 034327c3e778c31eb1d19cd661b460825a98037b (patch) | |
tree | 71a3707609175fe20d073a007d611b4f876a4f40 | |
parent | fcffb7dc23c05e3014e0299a4de28b6c25949d1b (diff) |
Clean up some variables for clang-tidy
-rw-r--r-- | utils/makemhr/makemhr.cpp | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/utils/makemhr/makemhr.cpp b/utils/makemhr/makemhr.cpp index 98e1b73f..8291ac0f 100644 --- a/utils/makemhr/makemhr.cpp +++ b/utils/makemhr/makemhr.cpp @@ -434,21 +434,18 @@ static int StoreMhr(const HrirDataT *hData, const char *filename) */ static void BalanceFieldMagnitudes(const HrirDataT *hData, const uint channels, const uint m) { - double maxMags[MAX_FD_COUNT]; - uint fi, ei, ti, i; - + std::array<double,MAX_FD_COUNT> maxMags{}; double maxMag{0.0}; - for(fi = 0;fi < hData->mFds.size();fi++) - { - maxMags[fi] = 0.0; - for(ei = hData->mFds[fi].mEvStart;ei < hData->mFds[fi].mEvs.size();ei++) + for(size_t fi{0};fi < hData->mFds.size();++fi) + { + for(size_t ei{hData->mFds[fi].mEvStart};ei < hData->mFds[fi].mEvs.size();++ei) { for(const auto &azd : hData->mFds[fi].mEvs[ei].mAzs) { - for(ti = 0;ti < channels;ti++) + for(size_t ti{0};ti < channels;++ti) { - for(i = 0;i < m;i++) + for(size_t i{0};i < m;++i) maxMags[fi] = std::max(azd.mIrs[ti][i], maxMags[fi]); } } @@ -457,17 +454,17 @@ static void BalanceFieldMagnitudes(const HrirDataT *hData, const uint channels, maxMag = std::max(maxMags[fi], maxMag); } - for(fi = 0;fi < hData->mFds.size();fi++) + for(size_t fi{0};fi < hData->mFds.size();++fi) { const double magFactor{maxMag / maxMags[fi]}; - for(ei = hData->mFds[fi].mEvStart;ei < hData->mFds[fi].mEvs.size();ei++) + for(size_t ei{hData->mFds[fi].mEvStart};ei < hData->mFds[fi].mEvs.size();++ei) { for(const auto &azd : hData->mFds[fi].mEvs[ei].mAzs) { - for(ti = 0;ti < channels;ti++) + for(size_t ti{0};ti < channels;++ti) { - for(i = 0;i < m;i++) + for(size_t i{0};i < m;++i) azd.mIrs[ti][i] *= magFactor; } } |