From 6920e1ccdd81f0bc2b4ce4adf65d9c1ae96679da Mon Sep 17 00:00:00 2001 From: dehnert Date: Wed, 22 May 2013 11:15:44 +0200 Subject: [PATCH] Added static_casts and changed some types to signed instead of unsigned to eliminate some warnings of MSVC. --- src/adapters/SymbolicExpressionAdapter.h | 8 ++++---- src/adapters/SymbolicModelAdapter.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/adapters/SymbolicExpressionAdapter.h b/src/adapters/SymbolicExpressionAdapter.h index 2e07bae83..fd23864b7 100644 --- a/src/adapters/SymbolicExpressionAdapter.h +++ b/src/adapters/SymbolicExpressionAdapter.h @@ -158,12 +158,12 @@ public: } storm::utility::CuddUtility* cuddUtility = storm::utility::cuddUtilityInstance(); - stack.push(new ADD(*cuddUtility->getConstant(expression->getValue()))); + stack.push(new ADD(*cuddUtility->getConstant(static_cast(expression->getValue())))); } virtual void visit(storm::ir::expressions::IntegerLiteral* expression) { storm::utility::CuddUtility* cuddUtility = storm::utility::cuddUtilityInstance(); - stack.push(new ADD(*cuddUtility->getConstant(expression->getValueAsInt(nullptr)))); + stack.push(new ADD(*cuddUtility->getConstant(static_cast(expression->getValueAsInt(nullptr))))); } virtual void visit(storm::ir::expressions::UnaryBooleanFunctionExpression* expression) { @@ -211,8 +211,8 @@ public: int64_t low = expression->getLowerBound()->getValueAsInt(nullptr); int64_t high = expression->getUpperBound()->getValueAsInt(nullptr); - for (uint_fast64_t i = low; i <= high; ++i) { - cuddUtility->setValueAtIndex(result, i - low, variables, i); + for (int_fast64_t i = low; i <= high; ++i) { + cuddUtility->setValueAtIndex(result, i - low, variables, static_cast(i)); } } diff --git a/src/adapters/SymbolicModelAdapter.h b/src/adapters/SymbolicModelAdapter.h index 819133a23..0ab93ac4d 100644 --- a/src/adapters/SymbolicModelAdapter.h +++ b/src/adapters/SymbolicModelAdapter.h @@ -81,8 +81,8 @@ public: int_fast64_t low = integerVariable.getLowerBound()->getValueAsInt(nullptr); int_fast64_t high = integerVariable.getUpperBound()->getValueAsInt(nullptr); - for (uint_fast64_t i = low; i <= high; ++i) { - cuddUtility->setValueAtIndex(temporary, i - low, variableToColumnDecisionDiagramVariableMap[assignmentPair.first], i); + for (int_fast64_t i = low; i <= high; ++i) { + cuddUtility->setValueAtIndex(temporary, i - low, variableToColumnDecisionDiagramVariableMap[assignmentPair.first], static_cast(i)); } ADD* result = new ADD(*updateExpr * *guard); @@ -194,7 +194,7 @@ private: cuddUtility->dumpDotToFile(newReachableStates, "reach1.add"); - newReachableStates = cuddUtility->permuteVariables(newReachableStates, allColumnDecisionDiagramVariables, allRowDecisionDiagramVariables, allDecisionDiagramVariables.size()); + newReachableStates = cuddUtility->permuteVariables(newReachableStates, allColumnDecisionDiagramVariables, allRowDecisionDiagramVariables, static_cast(allDecisionDiagramVariables.size())); *newReachableStates += *reachableStates; newReachableStates = new ADD(newReachableStates->GreaterThan(*cuddUtility->getZero())); @@ -232,7 +232,7 @@ private: int_fast64_t low = integerVariable.getLowerBound()->getValueAsInt(nullptr); int_fast64_t high = integerVariable.getUpperBound()->getValueAsInt(nullptr); - for (uint_fast64_t i = low; i <= high; ++i) { + for (int_fast64_t i = low; i <= high; ++i) { cuddUtility->setValueAtIndices(identity, i - low, i - low, variableToRowDecisionDiagramVariableMap[integerVariable.getName()], variableToColumnDecisionDiagramVariableMap[integerVariable.getName()], 1);