summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-07-03 11:04:56 +0200
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-08-08 17:24:00 +0200
commit9753260ef3e5bad3fc600987dbf9d82af259a4ea (patch)
treee0670f9ad7eb2afc57ebb1f93b7454faf74e9f2c /src/main.cpp
parente86177d7a54d8c2c0e096fd856e64bb9671267a4 (diff)
all: clang-format
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp35
1 files changed, 17 insertions, 18 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 85169de..571ffca 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -86,19 +86,20 @@ int main(int /*argc*/, char ** /*argv*/) {
struct connection c {};
d.r.add_global_handler(
- "wl_output", [&c](wl_registry *r, uint32_t name, uint32_t v) {
- c.outputs.emplace_back(std::make_unique<wl::output>(r, name, v));
- });
+ "wl_output", [&c](wl_registry *r, uint32_t name, uint32_t v) {
+ c.outputs.emplace_back(std::make_unique<wl::output>(r, name, v));
+ });
d.r.add_global_handler(
"ivi_controller", [&c](wl_registry *r, uint32_t name, uint32_t v) {
c.c = std::make_unique<genivi::controller>(r, name, v);
- // XXX: This protocol needs the output, so lets just add our mapping here...
- c.c->add_proxy_to_id_mapping(c.outputs.back()->proxy.get(),
- wl_proxy_get_id(
- reinterpret_cast<struct wl_proxy *>(
- c.outputs.back()->proxy.get())));
+ // XXX: This protocol needs the output, so lets just add our mapping
+ // here...
+ c.c->add_proxy_to_id_mapping(
+ c.outputs.back()->proxy.get(),
+ wl_proxy_get_id(reinterpret_cast<struct wl_proxy *>(
+ c.outputs.back()->proxy.get())));
});
// First level objects
@@ -112,18 +113,16 @@ int main(int /*argc*/, char ** /*argv*/) {
fatal("Could not init layout: %s", e);
}
- struct Poller p{};
+ struct Poller p {};
p.add_fd(STDIN_FILENO, [&c](int fd) {
- int buf;
- ssize_t ret;
- ret = read(fd, &buf, sizeof(buf));
- c.c->debug_dump_current_status();
- return ret == 0 ? -1 : 0;
+ int buf;
+ ssize_t ret;
+ ret = read(fd, &buf, sizeof(buf));
+ c.c->debug_dump_current_status();
+ return ret == 0 ? -1 : 0;
});
- p.add_fd(d.get_fd(), [&d](int fd) {
- return d.dispatch();
- });
+ p.add_fd(d.get_fd(), [&d](int fd) { return d.dispatch(); });
sigset_t sset{};
sigemptyset(&sset);
@@ -135,7 +134,7 @@ int main(int /*argc*/, char ** /*argv*/) {
p.add_fd(sfd.fd, [](int fd) {
struct signalfd_siginfo si;
while (read(fd, &si, sizeof(si)) == sizeof(si)) {
- lognotice("Received signal %u", si.ssi_signo);
+ lognotice("Received signal %u", si.ssi_signo);
}
return -1;
});