From 4fe071033b51c0ce6bc353a719b7b3a25e09d49d Mon Sep 17 00:00:00 2001 From: PBerger Date: Tue, 26 Feb 2013 01:21:54 +0100 Subject: [PATCH] Removed std:: from uint type specifier (illegal in VS2012) Removed parsing of STATES and TRANSITIONS from Parsers --- .../DeterministicSparseTransitionParser.cpp | 24 ------------------- ...NondeterministicSparseTransitionParser.cpp | 13 +--------- src/storage/SparseMatrix.h | 2 +- 3 files changed, 2 insertions(+), 37 deletions(-) diff --git a/src/parser/DeterministicSparseTransitionParser.cpp b/src/parser/DeterministicSparseTransitionParser.cpp index b4446be5b..a91c61525 100644 --- a/src/parser/DeterministicSparseTransitionParser.cpp +++ b/src/parser/DeterministicSparseTransitionParser.cpp @@ -46,24 +46,10 @@ namespace parser { */ uint_fast64_t DeterministicSparseTransitionParser::firstPass(char* buf, int_fast64_t& maxnode) { uint_fast64_t nonZeroEntryCount = 0; - uint_fast64_t inputFileNonZeroEntryCount = 0; /* * Check file header and extract number of transitions. */ buf = strchr(buf, '\n') + 1; // skip format hint - if (strncmp(buf, "STATES ", 7) != 0) { - LOG4CPLUS_ERROR(logger, "Expected \"STATES\" but got \"" << std::string(buf, 0, 16) << "\"."); - return 0; - } - buf += 7; // skip "STATES " - if (strtol(buf, &buf, 10) == 0) return 0; - buf = trimWhitespaces(buf); - if (strncmp(buf, "TRANSITIONS ", 12) != 0) { - LOG4CPLUS_ERROR(logger, "Expected \"TRANSITIONS\" but got \"" << std::string(buf, 0, 16) << "\"."); - return 0; - } - buf += 12; // skip "TRANSITIONS " - if ((inputFileNonZeroEntryCount = strtol(buf, &buf, 10)) == 0) return 0; /* * Check all transitions for non-zero diagonal entries and deadlock states. @@ -123,11 +109,6 @@ uint_fast64_t DeterministicSparseTransitionParser::firstPass(char* buf, int_fast ++nonZeroEntryCount; } - if (inputFileNonZeroEntryCount != readTransitionCount) { - LOG4CPLUS_ERROR(logger, "Input File TRANSITIONS line stated " << inputFileNonZeroEntryCount << " but there were " << readTransitionCount << " transitions afterwards."); - return 0; - } - return nonZeroEntryCount; } @@ -180,11 +161,6 @@ DeterministicSparseTransitionParser::DeterministicSparseTransitionParser(std::st * Read file header, extract number of states. */ buf = strchr(buf, '\n') + 1; // skip format hint - buf += 7; // skip "STATES " - checked_strtol(buf, &buf); - buf = trimWhitespaces(buf); - buf += 12; // skip "TRANSITIONS " - checked_strtol(buf, &buf); /* * Creating matrix here. diff --git a/src/parser/NondeterministicSparseTransitionParser.cpp b/src/parser/NondeterministicSparseTransitionParser.cpp index fd9bf3d4f..159b47e0d 100644 --- a/src/parser/NondeterministicSparseTransitionParser.cpp +++ b/src/parser/NondeterministicSparseTransitionParser.cpp @@ -54,18 +54,7 @@ uint_fast64_t NondeterministicSparseTransitionParser::firstPass(char* buf, uint_ * Check file header and extract number of transitions. */ buf = strchr(buf, '\n') + 1; // skip format hint - if (strncmp(buf, "STATES ", 7) != 0) { - LOG4CPLUS_ERROR(logger, "Expected \"STATES\" but got \"" << std::string(buf, 0, 16) << "\"."); - return 0; - } - buf += 7; // skip "STATES " - if (strtol(buf, &buf, 10) == 0) return 0; - buf = trimWhitespaces(buf); - if (strncmp(buf, "TRANSITIONS ", 12) != 0) { - LOG4CPLUS_ERROR(logger, "Expected \"TRANSITIONS\" but got \"" << std::string(buf, 0, 16) << "\"."); - return 0; - } - buf += 12; // skip "TRANSITIONS " + /* * Parse number of transitions. * We will not actually use this value, but we will compare it to the diff --git a/src/storage/SparseMatrix.h b/src/storage/SparseMatrix.h index 62ed99eca..970cbcd07 100644 --- a/src/storage/SparseMatrix.h +++ b/src/storage/SparseMatrix.h @@ -1110,7 +1110,7 @@ public: * to separate groups will be separated by a dashed line. * @return a (non-compressed) string representation of the matrix. */ - std::string toString(std::shared_ptr> nondeterministicChoiceIndices) const { + std::string toString(std::shared_ptr> nondeterministicChoiceIndices) const { std::stringstream result; uint_fast64_t currentNondeterministicChoiceIndex = 0;