Skip to content
Snippets Groups Projects
Commit a6333d06 authored by William F. Godoy's avatar William F. Godoy Committed by William F Godoy
Browse files

Correcting a warning from clang on Mac

unsigned int checking if < 0
Adding intermediate int verbosity for string conversion stoi
parent 105d3e05
No related branches found
No related tags found
1 merge request!136Correcting a warning on Mac
...@@ -276,19 +276,22 @@ void BP1Base::InitParameterMaxBufferSize(const std::string value) ...@@ -276,19 +276,22 @@ void BP1Base::InitParameterMaxBufferSize(const std::string value)
void BP1Base::InitParameterVerbose(const std::string value) void BP1Base::InitParameterVerbose(const std::string value)
{ {
int verbosity = -1;
if (m_DebugMode) if (m_DebugMode)
{ {
bool success = true; bool success = true;
try try
{ {
m_Verbosity = static_cast<unsigned int>(std::stoi(value)); verbosity = std::stoi(value);
} }
catch (std::exception &e) catch (std::exception &e)
{ {
success = false; success = false;
} }
if (!success || m_Verbosity < 0 || m_Verbosity > 5) if (!success || verbosity < 0 || verbosity > 5)
{ {
throw std::invalid_argument( throw std::invalid_argument(
"ERROR: value in Verbose=value in IO SetParameters must be " "ERROR: value in Verbose=value in IO SetParameters must be "
...@@ -297,8 +300,10 @@ void BP1Base::InitParameterVerbose(const std::string value) ...@@ -297,8 +300,10 @@ void BP1Base::InitParameterVerbose(const std::string value)
} }
else else
{ {
m_Verbosity = static_cast<unsigned int>(std::stoi(value)); verbosity = std::stoi(value);
} }
m_Verbosity = static_cast<unsigned int>(verbosity);
} }
std::vector<uint8_t> std::vector<uint8_t>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment