[PATCH weston 1/2] libweston/launcher: annotate iface(s) as constant data.

Emil Velikov emil.l.velikov at gmail.com
Fri Feb 10 20:14:22 UTC 2017


Already considered and handled as such.

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 libweston/launcher-direct.c        | 2 +-
 libweston/launcher-impl.h          | 8 ++++----
 libweston/launcher-logind.c        | 2 +-
 libweston/launcher-util.c          | 6 +++---
 libweston/launcher-weston-launch.c | 2 +-
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/libweston/launcher-direct.c b/libweston/launcher-direct.c
index 0ff99a44..8a961ee6 100644
--- a/libweston/launcher-direct.c
+++ b/libweston/launcher-direct.c
@@ -316,7 +316,7 @@ launcher_direct_get_vt(struct weston_launcher *base)
 	return minor(s.st_rdev);
 }
 
-struct launcher_interface launcher_direct_iface = {
+const struct launcher_interface launcher_direct_iface = {
 	launcher_direct_connect,
 	launcher_direct_destroy,
 	launcher_direct_open,
diff --git a/libweston/launcher-impl.h b/libweston/launcher-impl.h
index 8d090259..c16a7948 100644
--- a/libweston/launcher-impl.h
+++ b/libweston/launcher-impl.h
@@ -39,9 +39,9 @@ struct launcher_interface {
 };
 
 struct weston_launcher {
-	struct launcher_interface *iface;
+	const struct launcher_interface *iface;
 };
 
-extern struct launcher_interface launcher_logind_iface;
-extern struct launcher_interface launcher_weston_launch_iface;
-extern struct launcher_interface launcher_direct_iface;
+extern const struct launcher_interface launcher_logind_iface;
+extern const struct launcher_interface launcher_weston_launch_iface;
+extern const struct launcher_interface launcher_direct_iface;
diff --git a/libweston/launcher-logind.c b/libweston/launcher-logind.c
index 8b984a6e..c9cd75b7 100644
--- a/libweston/launcher-logind.c
+++ b/libweston/launcher-logind.c
@@ -837,7 +837,7 @@ launcher_logind_get_vt(struct weston_launcher *launcher)
 	return wl->vtnr;
 }
 
-struct launcher_interface launcher_logind_iface = {
+const struct launcher_interface launcher_logind_iface = {
 	launcher_logind_connect,
 	launcher_logind_destroy,
 	launcher_logind_open,
diff --git a/libweston/launcher-util.c b/libweston/launcher-util.c
index 2b828be8..fa3ed13b 100644
--- a/libweston/launcher-util.c
+++ b/libweston/launcher-util.c
@@ -35,7 +35,7 @@
 #include <unistd.h>
 #include <linux/input.h>
 
-static struct launcher_interface *ifaces[] = {
+static const struct launcher_interface *ifaces[] = {
 #ifdef HAVE_SYSTEMD_LOGIN
 	&launcher_logind_iface,
 #endif
@@ -48,10 +48,10 @@ WL_EXPORT struct weston_launcher *
 weston_launcher_connect(struct weston_compositor *compositor, int tty,
 			const char *seat_id, bool sync_drm)
 {
-	struct launcher_interface **it;
+	const struct launcher_interface **it;
 
 	for (it = ifaces; *it != NULL; it++) {
-		struct launcher_interface *iface = *it;
+		const struct launcher_interface *iface = *it;
 		struct weston_launcher *launcher;
 
 		if (iface->connect(&launcher, compositor, tty, seat_id, sync_drm) == 0)
diff --git a/libweston/launcher-weston-launch.c b/libweston/launcher-weston-launch.c
index 2c9128cf..36337c76 100644
--- a/libweston/launcher-weston-launch.c
+++ b/libweston/launcher-weston-launch.c
@@ -287,7 +287,7 @@ launcher_weston_launch_get_vt(struct weston_launcher *base)
 	return minor(s.st_rdev);
 }
 
-struct launcher_interface launcher_weston_launch_iface = {
+const struct launcher_interface launcher_weston_launch_iface = {
 	launcher_weston_launch_connect,
 	launcher_weston_launch_destroy,
 	launcher_weston_launch_open,
-- 
2.11.0



More information about the wayland-devel mailing list