layers: clang-format
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>
Fri, 28 Jul 2017 13:06:42 +0000 (15:06 +0200)
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>
Tue, 8 Aug 2017 15:24:00 +0000 (17:24 +0200)
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
src/layers.cpp
src/layers.hpp

index 0d01080..5e7256e 100644 (file)
@@ -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!");
             }
          }
       }
index ec24a74..aed39c8 100644 (file)
@@ -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;