Skip to content
Snippets Groups Projects
Commit 94fffe4d authored by Zhou, Wenduo's avatar Zhou, Wenduo
Browse files

Refs #19324. Fixed windows warning.

parent 9293d76a
No related branches found
No related tags found
No related merge requests found
...@@ -163,9 +163,8 @@ void AddSampleLog::addSingleValueProperty(Run &theRun, ...@@ -163,9 +163,8 @@ void AddSampleLog::addSingleValueProperty(Run &theRun,
if (value_is_int) { if (value_is_int) {
// convert to integer // convert to integer
int intVal; int intVal;
bool convert_to_int = int convert_to_int = Strings::convert(propValue, intVal);
static_cast<bool>(Strings::convert(propValue, intVal)); if (convert_to_int == 0) {
if (!convert_to_int) {
// spit out error message and set to default value // spit out error message and set to default value
g_log.error() << "Error interpreting string '" << propValue g_log.error() << "Error interpreting string '" << propValue
<< "' as NumberType Int."; << "' as NumberType Int.";
...@@ -176,9 +175,8 @@ void AddSampleLog::addSingleValueProperty(Run &theRun, ...@@ -176,9 +175,8 @@ void AddSampleLog::addSingleValueProperty(Run &theRun,
} else { } else {
// convert to double // convert to double
double dblVal; double dblVal;
bool convert_to_dbl = int convert_to_dbl = Strings::convert(propValue, dblVal);
static_cast<bool>(Strings::convert(propValue, dblVal)); if (convert_to_dbl == 0) {
if (!convert_to_dbl) {
g_log.error() << "Error interpreting string '" << propValue g_log.error() << "Error interpreting string '" << propValue
<< "' as NumberType Double."; << "' as NumberType Double.";
throw std::runtime_error("Invalid double input."); throw std::runtime_error("Invalid double input.");
......
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