From ccad564c1621ba8aa69ce47ea9374da373b0bcce Mon Sep 17 00:00:00 2001 From: Marcus Fritzsch Date: Mon, 26 Jun 2017 13:26:50 +0200 Subject: main: pass struct conn by-reference to init_layout() Signed-off-by: Marcus Fritzsch --- src/main.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 3116313..c343a66 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,7 +19,7 @@ namespace { // | (__| | | | __/ (__| < | __/\ V / __/ | | | |_\__ \ | | | // \___|_| |_|\___|\___|_|\_\___\___| \_/ \___|_| |_|\__|___/ | | | // |_____| \_\/_/ -int check_events(struct wl::display &d, struct conn *c, int fd) { +int check_events(struct wl::display &d, struct conn &c, int fd) { struct pollfd pfd[2] = {{.fd = d.get_fd(), .events = POLLIN, .revents = 0}, {.fd = fd, .events = POLLIN, .revents = 0}}; @@ -43,9 +43,9 @@ int check_events(struct wl::display &d, struct conn *c, int fd) { ; // Display current status - if (!c->c->surfaces.empty()) { + if (!c.c->surfaces.empty()) { puts("Surfaces:"); - for (auto const &i : c->c->surfaces) { + for (auto const &i : c.c->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, @@ -54,9 +54,9 @@ int check_events(struct wl::display &d, struct conn *c, int fd) { puts("\b\b "); } - if (!c->c->layers.empty()) { + if (!c.c->layers.empty()) { puts("Layers:"); - for (auto const &i : c->c->layers) { + for (auto const &i : c.c->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, @@ -152,7 +152,7 @@ int main(int argc, char **argv) { init_layout(c); - while (check_events(d, &c, STDIN_FILENO) != -1) { + while (check_events(d, c, STDIN_FILENO) != -1) { c.c->execute_pending(); d.flush(); } -- cgit 1.2.3-korg