summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2018-10-30 13:17:37 -0700
committerPatrick Venture <venture@google.com>2018-10-30 13:21:07 -0700
commit34438968e0d32aea89344c14629fdf9d3c6c8ea1 (patch)
tree958901b02724ad9a65d53367410004894c537d2b
parentcaa73ad5cd0ecae2fb0789c52e5553aef98fdd21 (diff)
downloadphosphor-logging-34438968e0d32aea89344c14629fdf9d3c6c8ea1.zip
phosphor-logging-34438968e0d32aea89344c14629fdf9d3c6c8ea1.tar.gz
style: local variable entry shadows outer symbol
Many functions have a variable entry in a sub namespace to the outer symbol entry from phosphor-logging/log.hpp [phosphor-logging/log.hpp:73] -> [log_manager.hpp:104]: (style) Local variable entry shadows outer symbol [phosphor-logging/log.hpp:73] -> [log_manager.cpp:226]: (style) Local variable entry shadows outer symbol [phosphor-logging/log.hpp:73] -> [log_manager.cpp:243]: (style) Local variable entry shadows outer symbol [phosphor-logging/log.hpp:73] -> [elog_meta.hpp:37]: (style) Local variable entry shadows outer symbol Change-Id: Icf5d585ec05b0a545e515d0afb7d2267645a2f2c Signed-off-by: Patrick Venture <venture@google.com>
-rw-r--r--elog_meta.hpp8
-rw-r--r--log_manager.cpp14
-rw-r--r--log_manager.hpp4
3 files changed, 13 insertions, 13 deletions
diff --git a/elog_meta.hpp b/elog_meta.hpp
index 6e44406..b44f52d 100644
--- a/elog_meta.hpp
+++ b/elog_meta.hpp
@@ -34,13 +34,13 @@ inline void parse(const std::vector<std::string>& data,
std::map<std::string, std::string>& metadata)
{
constexpr auto separator = '=';
- for (const auto& entry : data)
+ for (const auto& entryItem : data)
{
- auto pos = entry.find(separator);
+ auto pos = entryItem.find(separator);
if (std::string::npos != pos)
{
- auto key = entry.substr(0, entry.find(separator));
- auto value = entry.substr(entry.find(separator) + 1);
+ auto key = entryItem.substr(0, entryItem.find(separator));
+ auto value = entryItem.substr(entryItem.find(separator) + 1);
metadata.emplace(std::move(key), std::move(value));
}
}
diff --git a/log_manager.cpp b/log_manager.cpp
index 46ada75..ddb5a1d 100644
--- a/log_manager.cpp
+++ b/log_manager.cpp
@@ -223,12 +223,12 @@ void Manager::processMetadata(const std::string& errorName,
{
// additionalData is a list of "metadata=value"
constexpr auto separator = '=';
- for (const auto& entry : additionalData)
+ for (const auto& entryItem : additionalData)
{
- auto found = entry.find(separator);
+ auto found = entryItem.find(separator);
if (std::string::npos != found)
{
- auto metadata = entry.substr(0, found);
+ auto metadata = entryItem.substr(0, found);
auto iter = meta.find(metadata);
if (meta.end() != iter)
{
@@ -240,8 +240,8 @@ void Manager::processMetadata(const std::string& errorName,
void Manager::erase(uint32_t entryId)
{
- auto entry = entries.find(entryId);
- if (entries.end() != entry)
+ auto entryFound = entries.find(entryId);
+ if (entries.end() != entryFound)
{
// Delete the persistent representation of this error.
fs::path errorPath(ERRLOG_PERSIST_PATH);
@@ -255,7 +255,7 @@ void Manager::erase(uint32_t entryId)
ids.erase(it);
}
};
- if (entry->second->severity() >= Entry::sevLowerLimit)
+ if (entryFound->second->severity() >= Entry::sevLowerLimit)
{
removeId(infoErrors, entryId);
}
@@ -263,7 +263,7 @@ void Manager::erase(uint32_t entryId)
{
removeId(realErrors, entryId);
}
- entries.erase(entry);
+ entries.erase(entryFound);
}
else
{
diff --git a/log_manager.hpp b/log_manager.hpp
index 864de1a..e6714af 100644
--- a/log_manager.hpp
+++ b/log_manager.hpp
@@ -101,9 +101,9 @@ class Manager : public details::ServerObject<details::ManagerIface>
auto iter = entries.begin();
while (iter != entries.end())
{
- auto entry = iter->first;
+ auto e = iter->first;
++iter;
- erase(entry);
+ erase(e);
}
}
OpenPOWER on IntegriCloud