From 2afd930914c9d31ed1da5ffd80b18f029e84f8c5 Mon Sep 17 00:00:00 2001 From: emersion Date: Mon, 12 Nov 2018 22:23:06 +0100 Subject: [PATCH] Use #if instead of #ifdef for WLR_HAS_* --- include/stringop.h | 7 +------ meson.build | 16 +++++++++++----- sway/commands/create_output.c | 4 ++-- sway/desktop/output.c | 9 --------- 4 files changed, 14 insertions(+), 22 deletions(-) diff --git a/include/stringop.h b/include/stringop.h index 01bbdaa9..919e605c 100644 --- a/include/stringop.h +++ b/include/stringop.h @@ -1,12 +1,7 @@ #ifndef _SWAY_STRINGOP_H #define _SWAY_STRINGOP_H -#include -#include "list.h" -#if !HAVE_DECL_SETENV -// Not sure why we need to provide this -extern int setenv(const char *, const char *, int); -#endif +#include "list.h" // array of whitespace characters to use for delims extern const char whitespace[]; diff --git a/meson.build b/meson.build index 6b23b4e3..8327b763 100644 --- a/meson.build +++ b/meson.build @@ -9,11 +9,17 @@ project( ], ) -add_project_arguments('-Wno-unused-parameter', language: 'c') -add_project_arguments('-Wno-unused-function', language: 'c') -add_project_arguments('-Wno-unused-result', language: 'c') -add_project_arguments('-DWL_HIDE_DEPRECATED', language: 'c') -add_project_arguments('-DWLR_USE_UNSTABLE', language: 'c') +add_project_arguments( + [ + '-DWL_HIDE_DEPRECATED', + '-DWLR_USE_UNSTABLE', + + '-Wno-unused-parameter', + '-Wno-unused-result', + '-Wundef', + ], + language: 'c', +) cc = meson.get_compiler('c') diff --git a/sway/commands/create_output.c b/sway/commands/create_output.c index 1c2464ea..3f870acb 100644 --- a/sway/commands/create_output.c +++ b/sway/commands/create_output.c @@ -1,7 +1,7 @@ #include #include #include -#ifdef WLR_HAS_X11_BACKEND +#if WLR_HAS_X11_BACKEND #include #endif #include "sway/commands.h" @@ -18,7 +18,7 @@ static void create_output(struct wlr_backend *backend, void *data) { wlr_wl_output_create(backend); *done = true; } -#ifdef WLR_HAS_X11_BACKEND +#if WLR_HAS_X11_BACKEND else if (wlr_backend_is_x11(backend)) { wlr_x11_output_create(backend); *done = true; diff --git a/sway/desktop/output.c b/sway/desktop/output.c index d48ddef3..c53a9c73 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -469,15 +469,6 @@ void output_damage_box(struct sway_output *output, struct wlr_box *_box) { wlr_output_damage_add_box(output->damage, &box); } -static void output_damage_whole_container_iterator(struct sway_container *con, - void *data) { - if (!sway_assert(con->view, "expected a view")) { - return; - } - struct sway_output *output = data; - output_damage_view(output, con->view, true); -} - void output_damage_whole_container(struct sway_output *output, struct sway_container *con) { // Pad the box by 1px, because the width is a double and might be a fraction