Skip to content

Commit

Permalink
Merge pull request #252 from akva2/sca_fixes
Browse files Browse the repository at this point in the history
Fixes for warnings from static code analysis
  • Loading branch information
atgeirr authored Jun 9, 2017
2 parents 89b84cc + b9dde75 commit d997b26
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion opm/common/OpmLog/CounterLog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace Opm {
class CounterLog : public LogBackend
{
public:
CounterLog(int64_t messageMask);
explicit CounterLog(int64_t messageMask);
CounterLog();

size_t numMessages(int64_t messageType) const;
Expand Down
2 changes: 1 addition & 1 deletion opm/common/OpmLog/MessageFormatter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ namespace Opm
}


SimpleMessageFormatter(const bool use_color_coding)
explicit SimpleMessageFormatter(const bool use_color_coding)
: use_color_coding_(use_color_coding)
{
prefix_flag_ = Log::MessageType::Warning + Log::MessageType::Error
Expand Down
2 changes: 1 addition & 1 deletion opm/common/OpmLog/MessageLimiter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ namespace Opm
{
}

MessageLimiter(const int tag_limit, const std::map<int64_t, int> category_limits)
MessageLimiter(const int tag_limit, const std::map<int64_t, int>& category_limits)
: tag_limit_(tag_limit < 0 ? NoLimit : tag_limit),
category_limits_(category_limits)
{
Expand Down
2 changes: 1 addition & 1 deletion opm/common/OpmLog/OpmLog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class OpmLog {

template <class BackendType>
static std::shared_ptr<BackendType> popBackend(const std::string& name) {
auto logger = OpmLog::getLogger();
auto logger = getLogger();
return logger->popBackend<BackendType>(name);
}

Expand Down
2 changes: 2 additions & 0 deletions opm/common/OpmLog/TimerLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@ namespace Opm {
TimerLog::TimerLog(const std::string& logFile) : StreamLog( logFile , StopTimer | StartTimer )
{
m_work.precision(8);
m_start = 0;
}

TimerLog::TimerLog(std::ostream& os) : StreamLog( os , StopTimer | StartTimer )
{
m_work.precision(8);
m_start = 0;
}


Expand Down
4 changes: 2 additions & 2 deletions opm/common/OpmLog/TimerLog.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ class TimerLog : public StreamLog {
static const int64_t StartTimer = 4096;
static const int64_t StopTimer = 8192;

TimerLog(const std::string& logFile);
TimerLog(std::ostream& os);
explicit TimerLog(const std::string& logFile);
explicit TimerLog(std::ostream& os);

void clear();
~TimerLog() {};
Expand Down

0 comments on commit d997b26

Please sign in to comment.