clang-tidy the place up
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>
Thu, 13 Jul 2017 07:38:59 +0000 (09:38 +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/app.cpp
src/main.cpp

index 6515978..29f37e4 100644 (file)
@@ -15,13 +15,12 @@ namespace wm {
 
     namespace {
         App *g_app;
-    }
+        }  // namespace
 
-    App::App(wl::display *d)
-            : api{this}, display{d}, controller{}, outputs()
-    {
-        assert(g_app == nullptr);
-        g_app = this;
+        App::App(wl::display *d)
+           : api{this}, display{d}, controller{}, outputs() {
+           assert(g_app == nullptr);
+           g_app = this;
     }
 
     int App::init() {
index 8bb0b5c..0e3a2bc 100644 (file)
@@ -1,7 +1,7 @@
+#include "app.hpp"
 #include "json_helper.hpp"
 #include "util.hpp"
 #include "wayland.hpp"
-#include "app.hpp"
 
 #include <algorithm>
 #include <json.h>
@@ -31,8 +31,8 @@ int afb_instance::init() {
    return this->app.init();
 }
 
-int display_event_callback(sd_event_source *evs, int fd, uint32_t events,
-                           void *data) {
+int display_event_callback(sd_event_source *evs, int /*fd*/, uint32_t events,
+                           void * /*data*/) {
    if ((events & EPOLLHUP) != 0) {
       logerror("The compositor hung up, dying now.");
       delete g_afb_instance;
@@ -40,10 +40,10 @@ int display_event_callback(sd_event_source *evs, int fd, uint32_t events,
       goto error;
    }
 
-   if (events & EPOLLIN) {
-       if (g_afb_instance->app.dispatch_events() == -1) {
-          goto error;
-       }
+   if ((events & EPOLLIN) != 0u) {
+      if (g_afb_instance->app.dispatch_events() == -1) {
+         goto error;
+      }
    }
 
    return 0;
@@ -112,4 +112,4 @@ int binding_init() noexcept {
 #include "afb_binding_glue.inl"
 
 extern "C" const struct afb_binding_v2 afbBindingV2 = {
-   "winman", NULL, NULL, winman_verbs, NULL, binding_init, NULL, 1};
+   "winman", nullptr, nullptr, winman_verbs, nullptr, binding_init, nullptr, 1};