From 67244869db215fde0698374a768c4050b7263bc4 Mon Sep 17 00:00:00 2001 From: PBerger <philipp.berger@rwth-aachen.de> Date: Thu, 30 Jun 2016 23:28:50 +0200 Subject: [PATCH] src/storage/BitVector: Replaced constant 1 unsigned long long with cast to decltype. This fixes a template resolvation error in std::max. src/storage/bisimulation/NondeterministicModelBisimulationDecomposition.cpp: Replaced "auto state = 0" with decltype declaration. This solves an issue where state is always signed, but should be unsigned. src/storage/dft/DFTBuilder.cpp: Added a static_cast to enforce proper conversion to size_t and silence the signed/unsigned comparison warning. Former-commit-id: 7a1a4c1f45be127fddcd0958b683488fd513ddda --- src/storage/BitVector.cpp | 2 +- .../NondeterministicModelBisimulationDecomposition.cpp | 4 ++-- src/storage/dft/DFTBuilder.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/storage/BitVector.cpp b/src/storage/BitVector.cpp index 81705d431..d7676c973 100644 --- a/src/storage/BitVector.cpp +++ b/src/storage/BitVector.cpp @@ -256,7 +256,7 @@ namespace storm { void BitVector::enlargeLiberally(uint_fast64_t minimumLength, bool init) { if(minimumLength > this->size()) { uint_fast64_t newLength = this->bucketCount(); - newLength = std::max(newLength, 1ull) << 6; + newLength = std::max(newLength, static_cast<decltype(newLength)>(1u)) << 6; while(newLength < minimumLength) { newLength = newLength << 1; } diff --git a/src/storage/bisimulation/NondeterministicModelBisimulationDecomposition.cpp b/src/storage/bisimulation/NondeterministicModelBisimulationDecomposition.cpp index c117b0628..a1eea43dc 100644 --- a/src/storage/bisimulation/NondeterministicModelBisimulationDecomposition.cpp +++ b/src/storage/bisimulation/NondeterministicModelBisimulationDecomposition.cpp @@ -74,7 +74,7 @@ namespace storm { } } - for (auto state = 0; state < this->model.getNumberOfStates(); ++state) { + for (decltype(this->model.getNumberOfStates()) state = 0; state < this->model.getNumberOfStates(); ++state) { updateOrderedQuotientDistributions(state); } } @@ -248,7 +248,7 @@ namespace storm { template<typename ModelType> bool NondeterministicModelBisimulationDecomposition<ModelType>::checkQuotientDistributions() const { std::vector<uint_fast64_t> nondeterministicChoiceIndices = this->model.getTransitionMatrix().getRowGroupIndices(); - for (auto state = 0; state < this->model.getNumberOfStates(); ++state) { + for (decltype(this->model.getNumberOfStates()) state = 0; state < this->model.getNumberOfStates(); ++state) { for (auto choice = nondeterministicChoiceIndices[state]; choice < nondeterministicChoiceIndices[state + 1]; ++choice) { storm::storage::Distribution<ValueType> distribution; for (auto const& element : this->model.getTransitionMatrix().getRow(choice)) { diff --git a/src/storage/dft/DFTBuilder.cpp b/src/storage/dft/DFTBuilder.cpp index 840f5b77b..019ebe6e1 100644 --- a/src/storage/dft/DFTBuilder.cpp +++ b/src/storage/dft/DFTBuilder.cpp @@ -79,7 +79,7 @@ namespace storm { template<typename ValueType> unsigned DFTBuilder<ValueType>::computeRank(DFTElementPointer const& elem) { - if(elem->rank() == -1) { + if(elem->rank() == static_cast<decltype(elem->rank())>(-1)) { if(elem->nrChildren() == 0 || elem->isDependency()) { elem->setRank(0); } else {