Browse Source

fixed some style issues reported by cpplint

tempestpy_adaptions
gereon 12 years ago
parent
commit
7a1bf4d834
  1. 39
      src/parser/NonDeterministicSparseTransitionParser.cpp
  2. 22
      src/parser/SparseStateRewardParser.cpp

39
src/parser/NonDeterministicSparseTransitionParser.cpp

@ -7,22 +7,24 @@
#include "src/parser/NonDeterministicSparseTransitionParser.h"
#include "src/utility/Settings.h"
#include "src/exceptions/FileIoException.h"
#include "src/exceptions/WrongFileFormatException.h"
#include "boost/integer/integer_mask.hpp"
#include <errno.h>
#include <time.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <locale.h>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <clocale>
#include <iostream>
#include <errno.h>
#include <time.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <locale.h>
#include <utility>
#include <string>
#include "src/utility/Settings.h"
#include "src/exceptions/FileIoException.h"
#include "src/exceptions/WrongFileFormatException.h"
#include "boost/integer/integer_mask.hpp"
#include "log4cplus/logger.h"
#include "log4cplus/loggingmacros.h"
extern log4cplus::Logger logger;
@ -152,12 +154,11 @@ uint_fast64_t NonDeterministicSparseTransitionParser::firstPass(char* buf, uint_
*/
NonDeterministicSparseTransitionParser::NonDeterministicSparseTransitionParser(std::string const &filename)
: matrix(nullptr)
{
: matrix(nullptr) {
/*
* Enforce locale where decimal point is '.'.
*/
setlocale( LC_NUMERIC, "C" );
setlocale(LC_NUMERIC, "C");
/*
* Open file.
@ -174,8 +175,7 @@ NonDeterministicSparseTransitionParser::NonDeterministicSparseTransitionParser(s
/*
* If first pass returned zero, the file format was wrong.
*/
if (nonzero == 0)
{
if (nonzero == 0) {
LOG4CPLUS_ERROR(logger, "Error while parsing " << filename << ": erroneous file format.");
throw storm::exceptions::WrongFileFormatException();
}
@ -227,8 +227,7 @@ NonDeterministicSparseTransitionParser::NonDeterministicSparseTransitionParser(s
/*
* Read all transitions from file.
*/
while (buf[0] != '\0')
{
while (buf[0] != '\0') {
/*
* Read source node and choice name.
*/
@ -244,7 +243,7 @@ NonDeterministicSparseTransitionParser::NonDeterministicSparseTransitionParser(s
for (uint_fast64_t node = lastsource + 1; node < source; node++) {
hadDeadlocks = true;
if (fixDeadlocks) {
this->rowMapping->insert( RowMapping::value_type( curRow, std::pair<uint_fast64_t,std::string>(node, "")) );
this->rowMapping->insert(RowMapping::value_type(curRow, std::pair<uint_fast64_t, std::string>(node, "")));
this->matrix->addNextValue(curRow, node, 1);
curRow++;
LOG4CPLUS_WARN(logger, "Warning while parsing " << filename << ": node " << node << " has no outgoing transitions. A self-loop was inserted.");
@ -257,7 +256,7 @@ NonDeterministicSparseTransitionParser::NonDeterministicSparseTransitionParser(s
/*
* Add this source-choice pair to rowMapping.
*/
this->rowMapping->insert( RowMapping::value_type( curRow, std::pair<uint_fast64_t,std::string>(source, choice)) );
this->rowMapping->insert(RowMapping::value_type(curRow, std::pair<uint_fast64_t, std::string>(source, choice)));
/*
* Skip name of choice.
@ -294,5 +293,5 @@ NonDeterministicSparseTransitionParser::NonDeterministicSparseTransitionParser(s
this->matrix->finalize();
}
} //namespace parser
} //namespace storm
} // namespace parser
} // namespace storm

22
src/parser/SparseStateRewardParser.cpp

@ -6,21 +6,23 @@
*/
#include "src/parser/SparseStateRewardParser.h"
#include "src/exceptions/WrongFileFormatException.h"
#include "src/exceptions/FileIoException.h"
#include "src/utility/OsDetection.h"
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <clocale>
#include <iostream>
#include <errno.h>
#include <time.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <locale.h>
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <clocale>
#include "src/exceptions/WrongFileFormatException.h"
#include "src/exceptions/FileIoException.h"
#include "src/utility/OsDetection.h"
#include "log4cplus/logger.h"
#include "log4cplus/loggingmacros.h"
extern log4cplus::Logger logger;
@ -67,5 +69,5 @@ SparseStateRewardParser::SparseStateRewardParser(uint_fast64_t stateCount, std::
}
}
} //namespace parser
} //namespace storm
} // namespace parser
} // namespace storm
Loading…
Cancel
Save