Unify the include style of shared/ headers
authorPekka Paalanen <pekka.paalanen@collabora.com>
Fri, 5 Apr 2019 13:09:45 +0000 (16:09 +0300)
committerPekka Paalanen <pekka.paalanen@collabora.com>
Fri, 4 Oct 2019 13:04:48 +0000 (16:04 +0300)
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 <libweston/dbus.h>

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 <pekka.paalanen@collabora.com>
18 files changed:
clients/nested-client.c
clients/nested.c
compositor/main.c
libweston-desktop/libweston-desktop.c
libweston/backend-drm/drm.c
libweston/backend-wayland/wayland.c
libweston/backend-x11/x11.c
libweston/pixel-formats.c
libweston/renderer-gl/egl-glue.c
libweston/renderer-gl/gl-renderer.c
libweston/timeline.c
libweston/weston-log-file.c
libweston/weston-log-flight-rec.c
libweston/weston-log-wayland.c
libweston/weston-log.c
tests/surface-screenshot-test.c
tests/timespec-test.c
xwayland/window-manager.c

index 9ef338bb706817b7c5820f6628622b0a8cd751d1..a9e034efbb629fddfed0a5268b928801cef5373f 100644 (file)
@@ -34,7 +34,7 @@
 #include <GLES2/gl2.h>
 #include <EGL/egl.h>
 
-#include "../shared/platform.h"
+#include "shared/platform.h"
 
 struct window;
 struct seat;
index bc51b584e9572c4f5fb15a39053aca2ea28dc782..2ec80ceb2edcc74f77ef9faa5dad9bedcf26c44a 100644 (file)
@@ -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;
index 6a0c9e558341cdc50b27268a2b73913bddfa5412..4dd11c9d945bbc69996b5ff3d9709c18bf0a9ddb 100644 (file)
@@ -48,9 +48,9 @@
 
 #include "weston.h"
 #include <libweston/libweston.h>
-#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 <libweston/version.h>
 #include "weston.h"
index 5d0a4a792048958119bff0c6c0d5fd9475c08d36..d92958d4cd90edb0973248fa1a645301ae83b8f9 100644 (file)
@@ -30,7 +30,7 @@
 
 #include <libweston/libweston.h>
 #include <libweston/zalloc.h>
-#include "helpers.h"
+#include "shared/helpers.h"
 
 #include <libweston-desktop/libweston-desktop.h>
 #include "internal.h"
index 24f64128f93869708756761678712c6a6346c308..f6fb827a5dd62c0ef791da2052fb4bb2844e1440 100644 (file)
@@ -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"
index 22a4342f6dd83b0f5e66eccc7c0ea339d869f363..5592becc59a8e1c0e57fb36d9a2d17fce73d803b 100644 (file)
@@ -49,7 +49,7 @@
 #include <libweston/libweston.h>
 #include <libweston/backend-wayland.h>
 #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"
index 778f1df38a437ba47504680aa96e3c623b9216c8..4ed3f5116b3f6f53f057d853ed4c23b24718b0e0 100644 (file)
@@ -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"
index d0c5403c0d9c1c485e7a220625d9b540a909b72b..79dc709ceecef821e72d570de352549b90f3eadf 100644 (file)
@@ -34,7 +34,7 @@
 #include <drm_fourcc.h>
 #include <wayland-client-protocol.h>
 
-#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
index 8cbde6dbb9ab11897f45a3737536c2a8d3ebf790..d96efeaebcbfd0cacec38a59131267c8251bfad0 100644 (file)
@@ -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 <assert.h>
 
index 35203b2b0825e1747f0603e9f7cc3e86ded7f6fb..142cb5bb0a7ae97a1f40dc096e22ac398e1c9ce6 100644 (file)
@@ -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))
index 2e7d8981dabd3080f547d12815c6840f770741a2..84b221a885d2e97572dde21ce0fa5e2edb12d2d6 100644 (file)
@@ -34,7 +34,7 @@
 
 #include "timeline.h"
 #include <libweston/libweston.h>
-#include "file-util.h"
+#include "shared/file-util.h"
 
 struct timeline_log {
        clock_t clk_id;
index c1c91ae4faf605b06bc37b4673c5d607710ba540..2cdb247d3df96e2b9f92356aa4b9430826a51e8f 100644 (file)
@@ -26,7 +26,7 @@
 #include "config.h"
 
 #include <libweston/weston-log.h>
-#include "helpers.h"
+#include "shared/helpers.h"
 #include <libweston/libweston.h>
 
 #include "weston-log-internal.h"
index 93927ba056a4184668719cdb35d891b063995cf7..d1d7c8bc1925c7f55bbc34d0998ea9b32dabd613 100644 (file)
@@ -26,7 +26,7 @@
 #include "config.h"
 
 #include <libweston/weston-log.h>
-#include "helpers.h"
+#include "shared/helpers.h"
 #include <libweston/libweston.h>
 
 #include "weston-log-internal.h"
index f620e64db98bd9b019f08c6294372244b1c17ffa..43fc288527b6f303968bbe11e11545a2fefae9c1 100644 (file)
@@ -26,7 +26,7 @@
 #include "config.h"
 
 #include <libweston/weston-log.h>
-#include "helpers.h"
+#include "shared/helpers.h"
 #include <libweston/libweston.h>
 
 #include "weston-log-internal.h"
index 3584462b01b9f6c3bcb272f63ce067ad9ced2b3e..493baedcb9514a1b9864e636e917117d6a8e02b2 100644 (file)
@@ -27,7 +27,7 @@
 #include "config.h"
 
 #include <libweston/weston-log.h>
-#include "helpers.h"
+#include "shared/helpers.h"
 #include <libweston/libweston.h>
 
 #include "weston-log-internal.h"
index d2647e622dbf0ffe3485df6aa4fc4ecc1bffc980..3d93ac58921a9b63a15d222f92fbce5ec34469f9 100644 (file)
@@ -35,7 +35,7 @@
 
 #include <libweston/libweston.h>
 #include "compositor/weston.h"
-#include "file-util.h"
+#include "shared/file-util.h"
 #include "libweston-internal.h"
 
 static char *
index 2440018720f8229555bd95f7f74ef42b1b7ec450..fa1e6a163813c3617cb10f797f4fe92b165529fb 100644 (file)
@@ -34,7 +34,7 @@
 #include <unistd.h>
 #include <time.h>
 
-#include "timespec-util.h"
+#include "shared/timespec-util.h"
 
 #include "shared/helpers.h"
 #include "zunitc/zunitc.h"
index 61460af8891b5e1a1c6ecdd93a30f9e9bacc4e32..66e32dc6f6a2149653f2a3cb4315eb01efab6d27 100644 (file)
@@ -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"