From: Marcus Fritzsch Date: Mon, 3 Jul 2017 09:04:56 +0000 (+0200) Subject: all: clang-format X-Git-Tag: 4.99.1~273 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=commitdiff_plain;h=9753260ef3e5bad3fc600987dbf9d82af259a4ea;p=staging%2Fwindowmanager.git all: clang-format Signed-off-by: Marcus Fritzsch --- 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(r, name, v)); - }); + "wl_output", [&c](wl_registry *r, uint32_t name, uint32_t v) { + c.outputs.emplace_back(std::make_unique(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(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( - 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( + 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; }); diff --git a/src/util.hpp b/src/util.hpp index bc45dfd..a2f0dbf 100644 --- a/src/util.hpp +++ b/src/util.hpp @@ -6,20 +6,21 @@ #include #ifdef __GNUC__ -#define ATTR_FORMAT(stringindex, firsttocheck) __attribute__((format(printf, stringindex, firsttocheck))) +#define ATTR_FORMAT(stringindex, firsttocheck) \ + __attribute__((format(printf, stringindex, firsttocheck))) #else #define ATTR_FORMAT(stringindex, firsttocheck) #endif -void lognotice(char const *fmt, ...) ATTR_FORMAT(1,2); -void logerror(char const *fmt, ...) ATTR_FORMAT(1,2); -void fatal(char const *fmt, ...) ATTR_FORMAT(1,2); +void lognotice(char const *fmt, ...) ATTR_FORMAT(1, 2); +void logerror(char const *fmt, ...) ATTR_FORMAT(1, 2); +void fatal(char const *fmt, ...) ATTR_FORMAT(1, 2); #ifdef DEBUG_OUTPUT -void logdebug(char const *fmt, ...) ATTR_FORMAT(1,2); +void logdebug(char const *fmt, ...) ATTR_FORMAT(1, 2); #else -static inline void logdebug(char const * fmt, ...) ATTR_FORMAT(1,2); -static inline void logdebug(char const * fmt, ...) {} +static inline void logdebug(char const *fmt, ...) ATTR_FORMAT(1, 2); +static inline void logdebug(char const *fmt, ...) {} #endif // _ _ _ __ _ diff --git a/src/wayland.cpp b/src/wayland.cpp index e7ba157..d3b82f0 100644 --- a/src/wayland.cpp +++ b/src/wayland.cpp @@ -425,7 +425,6 @@ void controller::layer_orientation(struct layer *l, int32_t orientation) { void controller::layer_screen(struct layer *l, struct wl_output *screen) { logdebug("genivi::layer %s @ %p s %p", __func__, this->proxy.get(), screen); - } void controller::layer_destroyed(struct layer *l) { @@ -724,8 +723,8 @@ void controller::debug_dump_current_status() { for (auto const &i : this->surfaces) { auto const &r = i.second->dst_rect; auto const &s = i.second->size; - printf("%d [%ux%u] (%ux%u@%dx%d), ", i.first, s.w, s.h, r.w, r.h, - r.x, r.y); + printf("%d [%ux%u] (%ux%u@%dx%d), ", i.first, s.w, s.h, r.w, r.h, r.x, + r.y); } puts("\b\b "); } @@ -735,8 +734,8 @@ void controller::debug_dump_current_status() { for (auto const &i : this->layers) { auto const &r = i.second->dst_rect; auto const &s = i.second->size; - printf("%d [%ux%u] (%ux%u@%dx%d), ", i.first, s.w, s.h, r.w, r.h, - r.x, r.y); + printf("%d [%ux%u] (%ux%u@%dx%d), ", i.first, s.w, s.h, r.w, r.h, r.x, + r.y); } puts("\b\b "); } diff --git a/src/wayland.hpp b/src/wayland.hpp index b66bca7..ce8360f 100644 --- a/src/wayland.hpp +++ b/src/wayland.hpp @@ -6,8 +6,8 @@ #include "util.hpp" #include -#include #include +#include #include // _ _ @@ -99,7 +99,7 @@ struct output : wayland_proxy { void done(); void scale(int32_t factor); }; -} +} // namespace wl // _ __ __ _ _ __ ___ ___ ___ _ __ __ _ ___ ___ // | '_ \ / _` | '_ ` _ \ / _ \/ __| '_ \ / _` |/ __/ _ \ @@ -289,8 +289,8 @@ struct controller : public wayland_proxy { void surface_orientation(struct surface *s, int32_t orientation); void surface_pixelformat(struct surface *s, int32_t pixelformat); void surface_layer(struct surface *s, struct ivi_controller_layer *layer); - void surface_stats(struct surface *s, uint32_t redraw_count, uint32_t frame_count, - uint32_t update_count, uint32_t pid, + void surface_stats(struct surface *s, uint32_t redraw_count, + uint32_t frame_count, uint32_t update_count, uint32_t pid, const char *process_name); void surface_destroyed(struct surface *s); void surface_content(struct surface *s, int32_t content_state); @@ -298,8 +298,8 @@ struct controller : public wayland_proxy { // layer void layer_visibility(struct layer *l, int32_t visibility); void layer_opacity(struct layer *l, float opacity); - void layer_source_rectangle(struct layer *l, int32_t x, int32_t y, int32_t width, - int32_t height); + void layer_source_rectangle(struct layer *l, int32_t x, int32_t y, + int32_t width, int32_t height); void layer_destination_rectangle(struct layer *l, int32_t x, int32_t y, int32_t width, int32_t height); void layer_configuration(struct layer *l, int32_t width, int32_t height); @@ -307,6 +307,6 @@ struct controller : public wayland_proxy { void layer_screen(struct layer *l, struct wl_output *screen); void layer_destroyed(struct layer *l); }; -} +} // namespace genivi #endif // !WM_WAYLAND_HPP