aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-06-19 15:45:04 +0900
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>2018-06-19 15:45:04 +0900
commiteec5c50c47baaf0b89e5bb174ea9659c6b7945af (patch)
tree1a71a8ce20b4931c5b5af906ef665ed329f2f868
parentb7db2471fa409f35b51ff06842d21cfd7d9ba793 (diff)
Fix build error : Warning C++1z
Depending on the SDK, warning for C++1z is emitted. Fix not to use the following idiom for(auto [key, value] : map) Change-Id: Ie13a46967825b9d41c0bd63abb6cd484710dd55d Signed-off-by: Kazumasa Mitsunari <knimitz@witz-inc.co.jp>
-rw-r--r--src/wm_client.cpp9
-rw-r--r--src/wm_client.hpp2
2 files changed, 8 insertions, 3 deletions
diff --git a/src/wm_client.cpp b/src/wm_client.cpp
index f05bd17..72517bd 100644
--- a/src/wm_client.cpp
+++ b/src/wm_client.cpp
@@ -92,10 +92,11 @@ unsigned WMClient::surfaceID(const string &role) const
std::string WMClient::role(unsigned surface) const
{
- for(const auto& [key, value] : this->role2surface)
+ for(const auto& x : this->role2surface)
{
- if(value == surface){
- return key;
+ if(x.second == surface)
+ {
+ return x.first;
}
}
return std::string("");
@@ -150,6 +151,7 @@ bool WMClient::removeRole(const string &role)
return ret;
}
+#ifndef GTEST_ENABLED
bool WMClient::subscribe(afb_req req, const string &evname)
{
if(evname != kKeyError){
@@ -182,6 +184,7 @@ void WMClient::emitError(WM_CLIENT_ERROR_EVENT ev)
HMI_DEBUG("wm", "afb_event_push failed: %m");
}
}
+#endif
void WMClient::dumpInfo()
{
diff --git a/src/wm_client.hpp b/src/wm_client.hpp
index e1ef75b..3af75af 100644
--- a/src/wm_client.hpp
+++ b/src/wm_client.hpp
@@ -52,8 +52,10 @@ class WMClient
bool removeSurfaceIfExist(unsigned surface);
bool removeRole(const std::string& role);
+#ifndef GTEST_ENABLED
bool subscribe(afb_req req, const std::string &event_name);
void emitError(WM_CLIENT_ERROR_EVENT ev);
+#endif
void dumpInfo();