Skip to content

Commit

Permalink
Fix GCC build
Browse files Browse the repository at this point in the history
  • Loading branch information
ev-mp committed Feb 6, 2020
1 parent e359167 commit 6c68efe
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions tools/fw-logger/string-formatter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ namespace fw_logger
string st_regular_exp = "[a-zA-Z]+";
regex e1(st_regular_exp);

for(auto exp = 0; exp<m.size(); exp++)
for(size_t exp = 0; exp<m.size(); exp++)
{
string str = m[exp];

Expand All @@ -93,16 +93,16 @@ namespace fw_logger
regex e2 = e1;
std::regex_search(str, m1, std::regex(e2));

for (auto exp = 0; exp < m1.size(); exp++)
for (size_t exp = 0; exp < m1.size(); exp++)
{
enum_name = m1[exp];
if (_enums.size()>0 && _enums.find(enum_name) != _enums.end())
{
auto vec = _enums[enum_name];
regex e3 = e;
// Verify user's input is within the enumerated range
int val = exp_replace_it->second;
// Validate user's input is within the enumerated values
auto it = std::find_if(vec.begin(), vec.end(), [val](auto& pair){ return pair.first == val; });
auto it = std::find_if(vec.begin(), vec.end(), [val](std::pair<int, std::string>& kvp){ return kvp.first == val; });
if (it != vec.end())
{
regex_replace(back_inserter(destTemp), source_temp.begin(), source_temp.end(), e3, it->second);
Expand All @@ -112,7 +112,7 @@ namespace fw_logger
stringstream s;
s << "Protocol Error recognized!\nImproper log message received: " << source_temp
<< ", invalid parameter: " << exp_replace_it->second << ".\n The range of supported values is \n";
for_each(vec.begin(), vec.end(), [&s](auto& pair) { s << pair.first << ":" << pair.second << " ,"; });
for_each(vec.begin(), vec.end(), [&s](std::pair<int, std::string>& kvp) { s << kvp.first << ":" << kvp.second << " ,"; });
std::cout << s.str().c_str() << std::endl;;
}
source_temp = destTemp;
Expand Down

0 comments on commit 6c68efe

Please sign in to comment.