From c232f8d93422512611badd456171e788abd86ba6 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Fri, 5 Apr 2019 16:09:45 +0300 Subject: [PATCH] Unify the include style of shared/ headers When all shared/ headers are included in the same way, we can drop unnecessary include seach paths from the compiler. This include style was chosen because it is prevalent in the code base. Doing anything different would have been a bigger patch. This also means that we need to keep the project root directory in the include search path, which means that one could accidentally include private headers with #include "libweston/dbus.h" or even #include IMO such problem is smaller than the churn caused by any of the alternatives, and we should be able to catch those in review. We might even be able to catch those with grep in CI if necessary. The "bad" include style was found with: $ for h in shared/*.h; do git grep -F $(basename $h); done | grep -vF '"shared/' Signed-off-by: Pekka Paalanen --- clients/nested-client.c | 2 +- clients/nested.c | 2 +- compositor/main.c | 6 +++--- libweston-desktop/libweston-desktop.c | 2 +- libweston/backend-drm/drm.c | 2 +- libweston/backend-wayland/wayland.c | 2 +- libweston/backend-x11/x11.c | 2 +- libweston/pixel-formats.c | 4 ++-- libweston/renderer-gl/egl-glue.c | 2 +- libweston/renderer-gl/gl-renderer.c | 2 +- libweston/timeline.c | 2 +- libweston/weston-log-file.c | 2 +- libweston/weston-log-flight-rec.c | 2 +- libweston/weston-log-wayland.c | 2 +- libweston/weston-log.c | 2 +- tests/surface-screenshot-test.c | 2 +- tests/timespec-test.c | 2 +- xwayland/window-manager.c | 2 +- 18 files changed, 21 insertions(+), 21 deletions(-) diff --git a/clients/nested-client.c b/clients/nested-client.c index 9ef338bb..a9e034ef 100644 --- a/clients/nested-client.c +++ b/clients/nested-client.c @@ -34,7 +34,7 @@ #include #include -#include "../shared/platform.h" +#include "shared/platform.h" struct window; struct seat; diff --git a/clients/nested.c b/clients/nested.c index bc51b584..2ec80ceb 100644 --- a/clients/nested.c +++ b/clients/nested.c @@ -51,7 +51,7 @@ #include "shared/xalloc.h" #include "window.h" -#include "weston-egl-ext.h" +#include "shared/weston-egl-ext.h" static int option_blit; diff --git a/compositor/main.c b/compositor/main.c index 6a0c9e55..4dd11c9d 100644 --- a/compositor/main.c +++ b/compositor/main.c @@ -48,9 +48,9 @@ #include "weston.h" #include -#include "../shared/os-compatibility.h" -#include "../shared/helpers.h" -#include "../shared/string-helpers.h" +#include "shared/os-compatibility.h" +#include "shared/helpers.h" +#include "shared/string-helpers.h" #include "git-version.h" #include #include "weston.h" diff --git a/libweston-desktop/libweston-desktop.c b/libweston-desktop/libweston-desktop.c index 5d0a4a79..d92958d4 100644 --- a/libweston-desktop/libweston-desktop.c +++ b/libweston-desktop/libweston-desktop.c @@ -30,7 +30,7 @@ #include #include -#include "helpers.h" +#include "shared/helpers.h" #include #include "internal.h" diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c index 24f64128..f6fb827a 100644 --- a/libweston/backend-drm/drm.c +++ b/libweston/backend-drm/drm.c @@ -57,7 +57,7 @@ #include "shared/timespec-util.h" #include "shared/string-helpers.h" #include "renderer-gl/gl-renderer.h" -#include "weston-egl-ext.h" +#include "shared/weston-egl-ext.h" #include "pixman-renderer.h" #include "pixel-formats.h" #include "libbacklight.h" diff --git a/libweston/backend-wayland/wayland.c b/libweston/backend-wayland/wayland.c index 22a4342f..5592becc 100644 --- a/libweston/backend-wayland/wayland.c +++ b/libweston/backend-wayland/wayland.c @@ -49,7 +49,7 @@ #include #include #include "renderer-gl/gl-renderer.h" -#include "weston-egl-ext.h" +#include "shared/weston-egl-ext.h" #include "pixman-renderer.h" #include "shared/helpers.h" #include "shared/image-loader.h" diff --git a/libweston/backend-x11/x11.c b/libweston/backend-x11/x11.c index 778f1df3..4ed3f511 100644 --- a/libweston/backend-x11/x11.c +++ b/libweston/backend-x11/x11.c @@ -58,7 +58,7 @@ #include "shared/timespec-util.h" #include "shared/file-util.h" #include "renderer-gl/gl-renderer.h" -#include "weston-egl-ext.h" +#include "shared/weston-egl-ext.h" #include "pixman-renderer.h" #include "presentation-time-server-protocol.h" #include "linux-dmabuf.h" diff --git a/libweston/pixel-formats.c b/libweston/pixel-formats.c index d0c5403c..79dc709c 100644 --- a/libweston/pixel-formats.c +++ b/libweston/pixel-formats.c @@ -34,7 +34,7 @@ #include #include -#include "helpers.h" +#include "shared/helpers.h" #include "wayland-util.h" #include "pixel-formats.h" @@ -60,7 +60,7 @@ .bits.a = a_, \ .component_type = PIXEL_COMPONENT_TYPE_FIXED -#include "weston-egl-ext.h" +#include "shared/weston-egl-ext.h" /** * Table of DRM formats supported by Weston; RGB, ARGB and YUV formats are diff --git a/libweston/renderer-gl/egl-glue.c b/libweston/renderer-gl/egl-glue.c index 8cbde6db..d96efeae 100644 --- a/libweston/renderer-gl/egl-glue.c +++ b/libweston/renderer-gl/egl-glue.c @@ -35,7 +35,7 @@ #include "gl-renderer.h" #include "gl-renderer-internal.h" #include "pixel-formats.h" -#include "weston-egl-ext.h" +#include "shared/weston-egl-ext.h" #include diff --git a/libweston/renderer-gl/gl-renderer.c b/libweston/renderer-gl/gl-renderer.c index 35203b2b..142cb5bb 100644 --- a/libweston/renderer-gl/gl-renderer.c +++ b/libweston/renderer-gl/gl-renderer.c @@ -57,7 +57,7 @@ #include "shared/helpers.h" #include "shared/platform.h" #include "shared/timespec-util.h" -#include "weston-egl-ext.h" +#include "shared/weston-egl-ext.h" #define GR_GL_VERSION(major, minor) \ (((uint32_t)(major) << 16) | (uint32_t)(minor)) diff --git a/libweston/timeline.c b/libweston/timeline.c index 2e7d8981..84b221a8 100644 --- a/libweston/timeline.c +++ b/libweston/timeline.c @@ -34,7 +34,7 @@ #include "timeline.h" #include -#include "file-util.h" +#include "shared/file-util.h" struct timeline_log { clock_t clk_id; diff --git a/libweston/weston-log-file.c b/libweston/weston-log-file.c index c1c91ae4..2cdb247d 100644 --- a/libweston/weston-log-file.c +++ b/libweston/weston-log-file.c @@ -26,7 +26,7 @@ #include "config.h" #include -#include "helpers.h" +#include "shared/helpers.h" #include #include "weston-log-internal.h" diff --git a/libweston/weston-log-flight-rec.c b/libweston/weston-log-flight-rec.c index 93927ba0..d1d7c8bc 100644 --- a/libweston/weston-log-flight-rec.c +++ b/libweston/weston-log-flight-rec.c @@ -26,7 +26,7 @@ #include "config.h" #include -#include "helpers.h" +#include "shared/helpers.h" #include #include "weston-log-internal.h" diff --git a/libweston/weston-log-wayland.c b/libweston/weston-log-wayland.c index f620e64d..43fc2885 100644 --- a/libweston/weston-log-wayland.c +++ b/libweston/weston-log-wayland.c @@ -26,7 +26,7 @@ #include "config.h" #include -#include "helpers.h" +#include "shared/helpers.h" #include #include "weston-log-internal.h" diff --git a/libweston/weston-log.c b/libweston/weston-log.c index 3584462b..493baedc 100644 --- a/libweston/weston-log.c +++ b/libweston/weston-log.c @@ -27,7 +27,7 @@ #include "config.h" #include -#include "helpers.h" +#include "shared/helpers.h" #include #include "weston-log-internal.h" diff --git a/tests/surface-screenshot-test.c b/tests/surface-screenshot-test.c index d2647e62..3d93ac58 100644 --- a/tests/surface-screenshot-test.c +++ b/tests/surface-screenshot-test.c @@ -35,7 +35,7 @@ #include #include "compositor/weston.h" -#include "file-util.h" +#include "shared/file-util.h" #include "libweston-internal.h" static char * diff --git a/tests/timespec-test.c b/tests/timespec-test.c index 24400187..fa1e6a16 100644 --- a/tests/timespec-test.c +++ b/tests/timespec-test.c @@ -34,7 +34,7 @@ #include #include -#include "timespec-util.h" +#include "shared/timespec-util.h" #include "shared/helpers.h" #include "zunitc/zunitc.h" diff --git a/xwayland/window-manager.c b/xwayland/window-manager.c index 61460af8..66e32dc6 100644 --- a/xwayland/window-manager.c +++ b/xwayland/window-manager.c @@ -45,7 +45,7 @@ #include "xwayland.h" #include "xwayland-internal-interface.h" -#include "cairo-util.h" +#include "shared/cairo-util.h" #include "hash.h" #include "shared/helpers.h"