[PATCH 2/3] compositor: fix option types

Tiago Vignatti tiago.vignatti at intel.com
Mon Mar 12 15:06:39 PDT 2012


Basically all integer options should be set as unsigned integers instead.
Funny that WESTON_OPTION_INTEGER is not being used anywhere now.

Signed-off-by: Tiago Vignatti <tiago.vignatti at intel.com>
---
 clients/eventdemo.c      |    8 ++++----
 src/compositor-drm.c     |    4 ++--
 src/compositor-openwfd.c |    4 ++--
 src/compositor-wayland.c |    4 ++--
 src/compositor-x11.c     |    6 +++---
 src/compositor.c         |    2 +-
 6 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/clients/eventdemo.c b/clients/eventdemo.c
index 5d0cc90..3ed0840 100644
--- a/clients/eventdemo.c
+++ b/clients/eventdemo.c
@@ -318,10 +318,10 @@ eventdemo_create(struct display *d)
  */
 static const struct weston_option eventdemo_options[] = {
 	{ WESTON_OPTION_STRING, "title", 0, &title },
-	{ WESTON_OPTION_INTEGER, "width", 'w', &width },
-	{ WESTON_OPTION_INTEGER, "height", 'h', &height },
-	{ WESTON_OPTION_INTEGER, "max-width", 0, &width_max },
-	{ WESTON_OPTION_INTEGER, "max-height", 0, &height_max },
+	{ WESTON_OPTION_UNSIGNED_INTEGER, "width", 'w', &width },
+	{ WESTON_OPTION_UNSIGNED_INTEGER, "height", 'h', &height },
+	{ WESTON_OPTION_UNSIGNED_INTEGER, "max-width", 0, &width_max },
+	{ WESTON_OPTION_UNSIGNED_INTEGER, "max-height", 0, &height_max },
 	{ WESTON_OPTION_BOOLEAN, "no-border", 'b', &noborder },
 	{ WESTON_OPTION_BOOLEAN, "log-redraw", '0', &log_redraw },
 	{ WESTON_OPTION_BOOLEAN, "log-resize", '0', &log_resize },
diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index ba7e642..8feb769 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -1646,9 +1646,9 @@ backend_init(struct wl_display *display, int argc, char *argv[])
 	const char *seat = default_seat;
 
 	const struct weston_option drm_options[] = {
-		{ WESTON_OPTION_INTEGER, "connector", 0, &connector },
+		{ WESTON_OPTION_UNSIGNED_INTEGER, "connector", 0, &connector },
 		{ WESTON_OPTION_STRING, "seat", 0, &seat },
-		{ WESTON_OPTION_INTEGER, "tty", 0, &tty },
+		{ WESTON_OPTION_UNSIGNED_INTEGER, "tty", 0, &tty },
 	};
 
 	parse_options(drm_options, ARRAY_LENGTH(drm_options), argc, argv);
diff --git a/src/compositor-openwfd.c b/src/compositor-openwfd.c
index 2dba07d..72c25a6 100644
--- a/src/compositor-openwfd.c
+++ b/src/compositor-openwfd.c
@@ -670,9 +670,9 @@ backend_init(struct wl_display *display, int argc, char *argv[])
 	const char *seat;
 
 	const struct weston_option wfd_options[] = {
-		{ WESTON_OPTION_INTEGER, "connector", 0, &connector },
+		{ WESTON_OPTION_UNSIGNED_INTEGER, "connector", 0, &connector },
 		{ WESTON_OPTION_STRING, "seat", 0, &seat },
-		{ WESTON_OPTION_INTEGER, "tty", 0, &tty },
+		{ WESTON_OPTION_UNSIGNED_INTEGER, "tty", 0, &tty },
 	};
 
 	parse_options(&wfd_options, ARRAY_LENGTH(wfd_options), argc, argv);
diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c
index 48358e3..2ffe374 100644
--- a/src/compositor-wayland.c
+++ b/src/compositor-wayland.c
@@ -728,8 +728,8 @@ backend_init(struct wl_display *display, int argc, char *argv[])
 	char *display_name = NULL;
 
 	const struct weston_option wayland_options[] = {
-		{ WESTON_OPTION_INTEGER, "width", 0, &width },
-		{ WESTON_OPTION_INTEGER, "height", 0, &height },
+		{ WESTON_OPTION_UNSIGNED_INTEGER, "width", 0, &width },
+		{ WESTON_OPTION_UNSIGNED_INTEGER, "height", 0, &height },
 		{ WESTON_OPTION_STRING, "display", 0, &display_name },
 	};
 
diff --git a/src/compositor-x11.c b/src/compositor-x11.c
index c3eaab7..b6b28de 100644
--- a/src/compositor-x11.c
+++ b/src/compositor-x11.c
@@ -827,10 +827,10 @@ backend_init(struct wl_display *display, int argc, char *argv[])
 	int width = 1024, height = 640, fullscreen = 0, count = 1;
 
 	const struct weston_option x11_options[] = {
-		{ WESTON_OPTION_INTEGER, "width", 0, &width },
-		{ WESTON_OPTION_INTEGER, "height", 0, &height },
+		{ WESTON_OPTION_UNSIGNED_INTEGER, "width", 0, &width },
+		{ WESTON_OPTION_UNSIGNED_INTEGER, "height", 0, &height },
 		{ WESTON_OPTION_BOOLEAN, "fullscreen", 0, &fullscreen },
-		{ WESTON_OPTION_INTEGER, "output-count", 0, &count },
+		{ WESTON_OPTION_UNSIGNED_INTEGER, "output-count", 0, &count },
 	};
 
 	parse_options(x11_options, ARRAY_LENGTH(x11_options), argc, argv);
diff --git a/src/compositor.c b/src/compositor.c
index f2ae2f6..a832d3f 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -2472,7 +2472,7 @@ int main(int argc, char *argv[])
 	const struct weston_option core_options[] = {
 		{ WESTON_OPTION_STRING, "backend", 'B', &backend },
 		{ WESTON_OPTION_STRING, "socket", 'S', &socket_name },
-		{ WESTON_OPTION_INTEGER, "idle-time", 'i', &idle_time },
+		{ WESTON_OPTION_UNSIGNED_INTEGER, "idle-time", 'i', &idle_time },
 		{ WESTON_OPTION_STRING, "shell", 's', &shell },
 		{ WESTON_OPTION_BOOLEAN, "xserver", 0, &xserver },
 	};
-- 
1.7.5.4



More information about the wayland-devel mailing list