summaryrefslogtreecommitdiffstats
path: root/src/main.cpp
diff options
context:
space:
mode:
authorMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-06-26 13:26:50 +0200
committerMarcus Fritzsch <marcus_fritzsch@mentor.com>2017-08-08 17:24:00 +0200
commitccad564c1621ba8aa69ce47ea9374da373b0bcce (patch)
tree3857224236ce84f787befe0ac25dcb6135c39e21 /src/main.cpp
parent3fc6d2e2cc8942e20ee57e6afb1d302ee1d35636 (diff)
main: pass struct conn by-reference to init_layout()
Signed-off-by: Marcus Fritzsch <marcus_fritzsch@mentor.com>
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp12
1 files changed, 6 insertions, 6 deletions
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();
}