diff --git a/src/parser/AutoParser.cpp b/src/parser/AutoParser.cpp index b4e72c4cf..4c2a91fde 100644 --- a/src/parser/AutoParser.cpp +++ b/src/parser/AutoParser.cpp @@ -76,18 +76,18 @@ namespace storm { // Open the file. MappedFile file(filename.c_str()); - LOG_THROW(file.getDataSize() >= hintLength, storm::exceptions::WrongFormatException, "File too short to be readable."); + LOG_THROW(file.getDataSize() >= STORM_PARSER_AUTOPARSER_HINT_LENGTH, storm::exceptions::WrongFormatException, "File too short to be readable."); char const* fileData = file.getData(); - char filehintBuffer[hintLength + 1]; - memcpy(filehintBuffer, fileData, hintLength); - filehintBuffer[hintLength] = 0; + char filehintBuffer[STORM_PARSER_AUTOPARSER_HINT_LENGTH + 1]; + memcpy(filehintBuffer, fileData, STORM_PARSER_AUTOPARSER_HINT_LENGTH); + filehintBuffer[STORM_PARSER_AUTOPARSER_HINT_LENGTH] = 0; // Find and read in the hint. - std::string formatString = "%" + std::to_string(hintLength) + "s"; + std::string formatString = "%" + std::to_string(STORM_PARSER_AUTOPARSER_HINT_LENGTH) + "s"; char hint[5]; #ifdef WINDOWS - sscanf_s(filehintBuffer, formatString.c_str(), hint, hintLength + 1); + sscanf_s(filehintBuffer, formatString.c_str(), hint, STORM_PARSER_AUTOPARSER_HINT_LENGTH + 1); #else int ret = sscanf(filehintBuffer, formatString.c_str(), hint); #endif diff --git a/src/parser/AutoParser.h b/src/parser/AutoParser.h index c3bab16e6..5041e2f3c 100644 --- a/src/parser/AutoParser.h +++ b/src/parser/AutoParser.h @@ -5,6 +5,8 @@ #include +#define STORM_PARSER_AUTOPARSER_HINT_LENGTH (10ull) + namespace storm { /*! @@ -48,7 +50,7 @@ namespace storm { private: // Define the maximal length of a hint in the file. - static constexpr uint_fast64_t hintLength = 10; + static uint_fast64_t hintLength; /*! * Opens the given file and parses the file format hint. diff --git a/src/storage/SparseMatrix.cpp b/src/storage/SparseMatrix.cpp index 0b5846acc..f310c61ad 100644 --- a/src/storage/SparseMatrix.cpp +++ b/src/storage/SparseMatrix.cpp @@ -749,9 +749,9 @@ namespace storm { void SparseMatrix::multiplyWithVectorSequential(std::vector const& vector, std::vector& result) const { const_iterator it = this->begin(); const_iterator ite; - typename std::vector::const_iterator rowIterator = rowIndications.begin(); - typename std::vector::iterator resultIterator = result.begin(); - typename std::vector::iterator resultIteratorEnd = result.end(); + std::vector::const_iterator rowIterator = rowIndications.begin(); + std::vector::iterator resultIterator = result.begin(); + std::vector::iterator resultIteratorEnd = result.end(); for (; resultIterator != resultIteratorEnd; ++rowIterator, ++resultIterator) { *resultIterator = storm::utility::constantZero(); @@ -773,8 +773,8 @@ namespace storm { const_iterator ite; std::vector::const_iterator rowIterator = this->rowIndications.begin() + startRow; std::vector::const_iterator rowIteratorEnd = this->rowIndications.begin() + endRow; - typename std::vector::iterator resultIterator = result.begin() + startRow; - typename std::vector::iterator resultIteratorEnd = result.begin() + endRow; + std::vector::iterator resultIterator = result.begin() + startRow; + std::vector::iterator resultIteratorEnd = result.begin() + endRow; for (; resultIterator != resultIteratorEnd; ++rowIterator, ++resultIterator) { *resultIterator = storm::utility::constantZero();