summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-07-28 15:06:42 +0200
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-08-08 17:24:00 +0200
commit688d3bead2846824b2cbf5596d65dec5690a035d (patch)
tree14a84f95d49792560fe3446a9bd015e153d79776
parentb1086ca88caec808780162f068b04a8e9af89b58 (diff)
layers: clang-format
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
-rw-r--r--src/layers.cpp26
-rw-r--r--src/layers.hpp4
2 files changed, 15 insertions, 15 deletions
diff --git a/src/layers.cpp b/src/layers.cpp
index 0d01080..5e7256e 100644
--- a/src/layers.cpp
+++ b/src/layers.cpp
@@ -31,14 +31,13 @@ struct result<struct surface_id_to_layer_map> to_surface_id_to_layer_map(
surface_id_to_layer_map stl{};
auto m = j["mappings"];
stl.layers.reserve(m.size());
- std::transform(
- std::cbegin(m), std::cend(m),
- std::inserter(stl.mapping, stl.mapping.end()),
- [&stl](nlohmann::json const &j) {
- auto k = surface_id_to_layer(j);
- stl.layers.push_back(unsigned(k.layer_id));
- return k;
- });
+ std::transform(std::cbegin(m), std::cend(m),
+ std::inserter(stl.mapping, stl.mapping.end()),
+ [&stl](nlohmann::json const &j) {
+ auto k = surface_id_to_layer(j);
+ stl.layers.push_back(unsigned(k.layer_id));
+ return k;
+ });
// XXX need to sort layers?
for (auto i : stl.mapping) {
if (i.name.empty()) {
@@ -54,15 +53,16 @@ struct result<struct surface_id_to_layer_map> to_surface_id_to_layer_map(
// Check lookup
auto jtests = j.value("tests", json());
- if (! jtests.empty()) {
+ if (!jtests.empty()) {
DB("Embedded tests...");
std::vector<std::pair<int, int>> tests;
tests.reserve(jtests.size());
std::transform(std::cbegin(jtests), std::cend(jtests),
std::back_inserter(tests), [](json const &j) {
- return std::make_pair(get<int>(j["surface_id"]),
- get<int>(j["expect_layer_id"]));
- });
+ return std::make_pair(
+ get<int>(j["surface_id"]),
+ get<int>(j["expect_layer_id"]));
+ });
for (auto sid : tests) {
int lid = stl.get_layer_for_surface(sid.first).value_or(-1);
@@ -70,7 +70,7 @@ struct result<struct surface_id_to_layer_map> to_surface_id_to_layer_map(
<< ", expect=" << sid.second);
if (lid != sid.second) {
return Err<surface_id_to_layer_map>(
- "ID Map embedded test failed!");
+ "ID Map embedded test failed!");
}
}
}
diff --git a/src/layers.hpp b/src/layers.hpp
index ec24a74..aed39c8 100644
--- a/src/layers.hpp
+++ b/src/layers.hpp
@@ -26,8 +26,8 @@ struct surface_id_to_layer {
}
};
-// Actually, we shouldn't need a struct here ... but let's just keep it at that for now,
-// to contain its mapping type and the _single_ useful method.
+// Actually, we shouldn't need a struct here ... but let's just keep it at that
+// for now, to contain its mapping type and the _single_ useful method.
struct surface_id_to_layer_map {
typedef std::set<struct surface_id_to_layer> surface_to_layer_map_type;
typedef std::vector<unsigned int> layers_type;