From 4e870a98a8a2e589f7e1487770665afa32d2cb9b Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Wed, 30 May 2018 14:48:04 +0200 Subject: Avoid variable shadowing function warnings --- src/Flowgraph.cpp | 10 ++++++++++ src/Flowgraph.h | 6 ++---- src/Log.cpp | 12 ++++++------ 3 files changed, 18 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/Flowgraph.cpp b/src/Flowgraph.cpp index c14280e..e594d70 100644 --- a/src/Flowgraph.cpp +++ b/src/Flowgraph.cpp @@ -198,6 +198,16 @@ int Node::process() return ret; } +time_t Node::processTime() const +{ + return myProcessTime; +} + +void Node::addProcessTime(time_t time) +{ + myProcessTime += time; +} + Edge::Edge(shared_ptr& srcNode, shared_ptr& dstNode) : mySrcNode(srcNode), myDstNode(dstNode) diff --git a/src/Flowgraph.h b/src/Flowgraph.h index 08ead14..43550d0 100644 --- a/src/Flowgraph.h +++ b/src/Flowgraph.h @@ -51,10 +51,8 @@ public: std::shared_ptr plugin() { return myPlugin; } int process(); - time_t processTime() { return myProcessTime; } - void addProcessTime(time_t processTime) { - myProcessTime += processTime; - } + time_t processTime() const; + void addProcessTime(time_t time); void addOutputBuffer(Buffer::sptr& buffer, Metadata_vec_sptr& md); void removeOutputBuffer(Buffer::sptr& buffer, Metadata_vec_sptr& md); diff --git a/src/Log.cpp b/src/Log.cpp index 15c02d0..3c5b181 100644 --- a/src/Log.cpp +++ b/src/Log.cpp @@ -47,7 +47,7 @@ void Logger::register_backend(std::shared_ptr backend) } -void Logger::log(log_level_t level, const char* fmt, ...) +void Logger::log(log_level_t lvl, const char* fmt, ...) { int size = 100; std::string str; @@ -67,12 +67,12 @@ void Logger::log(log_level_t level, const char* fmt, ...) size *= 2; } - logstr(level, move(str)); + logstr(lvl, move(str)); } -void Logger::logstr(log_level_t level, std::string&& message) +void Logger::logstr(log_level_t lvl, std::string&& message) { - log_message_t m(level, move(message)); + log_message_t m(lvl, move(message)); m_message_queue.push(move(m)); } @@ -108,9 +108,9 @@ void Logger::io_process() } } -LogLine Logger::level(log_level_t level) +LogLine Logger::level(log_level_t lvl) { - return LogLine(this, level); + return LogLine(this, lvl); } LogToFile::LogToFile(const std::string& filename) : name("FILE") -- cgit v1.2.3