Skip to content

Commit

Permalink
Merge branch 'feature/iss-125' into upstream-master
Browse files Browse the repository at this point in the history
  • Loading branch information
damb committed Aug 22, 2022
2 parents 3372889 + 51695d6 commit f5ccc42
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/apps/cc/config/detector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,12 @@ TemplateConfig::TemplateConfig(const boost::property_tree::ptree &pt,
wfStreamId = streamConfig.wfStreamId;
} catch (boost::property_tree::ptree_error &e) {
throw config::ParserException{
std::string{"Exception while parsing stream config: "} + e.what()};
std::string{"exception while parsing stream config: "} + e.what()};
}

if (!_streamConfigs[wfStreamId].isValid()) {
throw config::ParserException{
std::string{"Exception while parsing streamConfig: Invalid "
std::string{"exception while parsing streamConfig: invalid "
"stream configuration for stream: "} +
wfStreamId};
}
Expand All @@ -212,7 +212,7 @@ TemplateConfig::TemplateConfig(const boost::property_tree::ptree &pt,

if (!_detectorConfig.isValid(maxArrivals)) {
throw config::ParserException{
"Invalid template specific detector configuration"};
"invalid template specific detector configuration"};
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/apps/cc/config/validators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ bool validateMinArrivals(int n, int numStreamConfigs) {
return true;
}

return numStreamConfigs > 0 ? n >= 1 : n >= 1 && n <= numStreamConfigs;
return numStreamConfigs > 0 ? n >= 1 && n <= numStreamConfigs : n >= 1;
}

bool validateSamplingFrequency(double samplingFrequency) {
Expand Down
11 changes: 5 additions & 6 deletions src/apps/cc/detector/linker/pot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,19 +146,18 @@ bool POT::validateEnabledOffsets(const std::string &processorId,
return false;
}

std::vector<bool> commonMask(size());
// create mask with common enabled processors
std::vector<bool> common_mask(size(), false);
size_type i{0};
for (const auto &p : _processorIdxMap) {
if (p.second.enabled && otherMask[i]) {
common_mask[i++] = true;
}
for (const auto &idxPair : _processorIdxMap) {
commonMask[i] = idxPair.second.enabled && otherMask[i];
++i;
}

const auto &offsets{_offsets[std::distance(_processorIdxMap.begin(), it)]};

for (size_type i{0}; i < size(); ++i) {
if (common_mask[i] && validEntry(otherOffsets[i]) &&
if (commonMask[i] && validEntry(otherOffsets[i]) &&
validEntry(offsets[i]) &&
util::greaterThan(std::abs(offsets[i] - otherOffsets[i]),
static_cast<double>(thres), tolerance)) {
Expand Down

0 comments on commit f5ccc42

Please sign in to comment.