Browse Source

Fixed some GCC warnings

tempestpy_adaptions
Matthias Volk 5 years ago
parent
commit
a61ea32aea
  1. 10
      src/storm-pars/modelchecker/results/RegionRefinementCheckResult.cpp
  2. 2
      src/storm-parsers/parser/DirectEncodingParser.cpp
  3. 3
      src/storm/logic/CumulativeRewardFormula.cpp
  4. 2
      src/storm/logic/InstantaneousRewardFormula.cpp

10
src/storm-pars/modelchecker/results/RegionRefinementCheckResult.cpp

@ -48,7 +48,10 @@ namespace storm {
out << "Region refinement Check result (visualization):" << std::endl; out << "Region refinement Check result (visualization):" << std::endl;
out << " \t x-axis: " << x << " \t y-axis: " << y << " \t S=safe, [ ]=unsafe, -=ambiguous " << std::endl; out << " \t x-axis: " << x << " \t y-axis: " << y << " \t S=safe, [ ]=unsafe, -=ambiguous " << std::endl;
for (uint_fast64_t i = 0; i < sizeX+2; ++i) out << "#"; out << std::endl;
for (uint_fast64_t i = 0; i < sizeX+2; ++i) {
out << "#";
}
out << std::endl;
CoefficientType deltaX = (getParameterSpace().getUpperBoundary(x) - getParameterSpace().getLowerBoundary(x)) / storm::utility::convertNumber<CoefficientType>(sizeX); CoefficientType deltaX = (getParameterSpace().getUpperBoundary(x) - getParameterSpace().getLowerBoundary(x)) / storm::utility::convertNumber<CoefficientType>(sizeX);
CoefficientType deltaY = (getParameterSpace().getUpperBoundary(y) - getParameterSpace().getLowerBoundary(y)) / storm::utility::convertNumber<CoefficientType>(sizeY); CoefficientType deltaY = (getParameterSpace().getUpperBoundary(y) - getParameterSpace().getLowerBoundary(y)) / storm::utility::convertNumber<CoefficientType>(sizeY);
@ -94,7 +97,10 @@ namespace storm {
} }
out << "#" << std::endl; out << "#" << std::endl;
} }
for (uint_fast64_t i = 0; i < sizeX+2; ++i) out << "#"; out << std::endl;
for (uint_fast64_t i = 0; i < sizeX+2; ++i) {
out << "#";
}
out << std::endl;
} else { } else {
STORM_LOG_WARN("Writing illustration of region check result to a stream is only implemented for two parameters."); STORM_LOG_WARN("Writing illustration of region check result to a stream is only implemented for two parameters.");
} }

2
src/storm-parsers/parser/DirectEncodingParser.cpp

@ -164,7 +164,6 @@ namespace storm {
// Iterate over all lines // Iterate over all lines
std::string line; std::string line;
size_t row = 0; size_t row = 0;
size_t firstRowOfState = 0;
size_t state = 0; size_t state = 0;
bool firstState = true; bool firstState = true;
bool firstActionForState = true; bool firstActionForState = true;
@ -197,7 +196,6 @@ namespace storm {
STORM_LOG_TRACE("new Row Group starts at " << row << "."); STORM_LOG_TRACE("new Row Group starts at " << row << ".");
builder.newRowGroup(row); builder.newRowGroup(row);
} }
firstRowOfState = row;
if (continuousTime) { if (continuousTime) {
// Parse exit rate for CTMC or MA // Parse exit rate for CTMC or MA

3
src/storm/logic/CumulativeRewardFormula.cpp

@ -99,7 +99,6 @@ namespace storm {
double CumulativeRewardFormula::getBound(unsigned i) const { double CumulativeRewardFormula::getBound(unsigned i) const {
checkNoVariablesInBound(bounds.at(i).getBound()); checkNoVariablesInBound(bounds.at(i).getBound());
double value = bounds.at(i).getBound().evaluateAsDouble(); double value = bounds.at(i).getBound().evaluateAsDouble();
STORM_LOG_THROW(value >= 0.0, storm::exceptions::InvalidPropertyException, "Time-bound must not evaluate to negative number.");
return value; return value;
} }
@ -107,7 +106,6 @@ namespace storm {
storm::RationalNumber CumulativeRewardFormula::getBound(unsigned i) const { storm::RationalNumber CumulativeRewardFormula::getBound(unsigned i) const {
checkNoVariablesInBound(bounds.at(i).getBound()); checkNoVariablesInBound(bounds.at(i).getBound());
storm::RationalNumber value = bounds.at(i).getBound().evaluateAsRational(); storm::RationalNumber value = bounds.at(i).getBound().evaluateAsRational();
STORM_LOG_THROW(value >= storm::utility::zero<storm::RationalNumber>(), storm::exceptions::InvalidPropertyException, "Time-bound must not evaluate to negative number.");
return value; return value;
} }
@ -115,7 +113,6 @@ namespace storm {
uint64_t CumulativeRewardFormula::getBound(unsigned i) const { uint64_t CumulativeRewardFormula::getBound(unsigned i) const {
checkNoVariablesInBound(bounds.at(i).getBound()); checkNoVariablesInBound(bounds.at(i).getBound());
uint64_t value = bounds.at(i).getBound().evaluateAsInt(); uint64_t value = bounds.at(i).getBound().evaluateAsInt();
STORM_LOG_THROW(value >= 0, storm::exceptions::InvalidPropertyException, "Time-bound must not evaluate to negative number.");
return value; return value;
} }

2
src/storm/logic/InstantaneousRewardFormula.cpp

@ -55,7 +55,7 @@ namespace storm {
template <> template <>
uint64_t InstantaneousRewardFormula::getBound() const { uint64_t InstantaneousRewardFormula::getBound() const {
checkNoVariablesInBound(bound); checkNoVariablesInBound(bound);
uint64_t value = bound.evaluateAsInt();
int64_t value = bound.evaluateAsInt();
STORM_LOG_THROW(value >= 0, storm::exceptions::InvalidPropertyException, "Time-bound must not evaluate to negative number."); STORM_LOG_THROW(value >= 0, storm::exceptions::InvalidPropertyException, "Time-bound must not evaluate to negative number.");
return value; return value;
} }

Loading…
Cancel
Save