[PATCH] Convert all scales to int32_t

alexl at redhat.com alexl at redhat.com
Fri May 24 04:09:43 PDT 2013


From: Alexander Larsson <alexl at redhat.com>

The type changed in the protocol, so update weston for this.
---
 clients/desktop-shell.c |  2 +-
 clients/window.c        | 24 ++++++++++++------------
 clients/window.h        |  2 +-
 src/compositor-x11.c    |  4 ++--
 src/compositor.c        | 12 ++++++------
 src/compositor.h        | 14 +++++++-------
 6 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c
index 40dd1dd..51ce3ec 100644
--- a/clients/desktop-shell.c
+++ b/clients/desktop-shell.c
@@ -1115,7 +1115,7 @@ output_handle_done(void *data,
 static void
 output_handle_scale(void *data,
                     struct wl_output *wl_output,
-                    uint32_t scale)
+                    int32_t scale)
 {
 	struct output *output = data;
 
diff --git a/clients/window.c b/clients/window.c
index b2e1af7..3870898 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -159,7 +159,7 @@ struct toysurface {
 	 */
 	cairo_surface_t *(*prepare)(struct toysurface *base, int dx, int dy,
 				    int32_t width, int32_t height, uint32_t flags,
-				    enum wl_output_transform buffer_transform, uint32_t buffer_scale);
+				    enum wl_output_transform buffer_transform, int32_t buffer_scale);
 
 	/*
 	 * Post the surface to the server, returning the server allocation
@@ -167,7 +167,7 @@ struct toysurface {
 	 * after calling this.
 	 */
 	void (*swap)(struct toysurface *base,
-		     enum wl_output_transform buffer_transform, uint32_t buffer_scale,
+		     enum wl_output_transform buffer_transform, int32_t buffer_scale,
 		     struct rectangle *server_allocation);
 
 	/*
@@ -210,7 +210,7 @@ struct surface {
 
 	enum window_buffer_type buffer_type;
 	enum wl_output_transform buffer_transform;
-	uint32_t buffer_scale;
+	int32_t buffer_scale;
 
 	cairo_surface_t *cairo_surface;
 
@@ -468,7 +468,7 @@ debug_print(void *proxy, int line, const char *func, const char *fmt, ...)
 #endif
 
 static void
-surface_to_buffer_size (enum wl_output_transform buffer_transform, uint32_t buffer_scale, int32_t *width, int32_t *height)
+surface_to_buffer_size (enum wl_output_transform buffer_transform, int32_t buffer_scale, int32_t *width, int32_t *height)
 {
 	int32_t tmp;
 
@@ -490,7 +490,7 @@ surface_to_buffer_size (enum wl_output_transform buffer_transform, uint32_t buff
 }
 
 static void
-buffer_to_surface_size (enum wl_output_transform buffer_transform, uint32_t buffer_scale, int32_t *width, int32_t *height)
+buffer_to_surface_size (enum wl_output_transform buffer_transform, int32_t buffer_scale, int32_t *width, int32_t *height)
 {
 	int32_t tmp;
 
@@ -531,7 +531,7 @@ to_egl_window_surface(struct toysurface *base)
 static cairo_surface_t *
 egl_window_surface_prepare(struct toysurface *base, int dx, int dy,
 			   int32_t width, int32_t height, uint32_t flags,
-			   enum wl_output_transform buffer_transform, uint32_t buffer_scale)
+			   enum wl_output_transform buffer_transform, int32_t buffer_scale)
 {
 	struct egl_window_surface *surface = to_egl_window_surface(base);
 
@@ -545,7 +545,7 @@ egl_window_surface_prepare(struct toysurface *base, int dx, int dy,
 
 static void
 egl_window_surface_swap(struct toysurface *base,
-			enum wl_output_transform buffer_transform, uint32_t buffer_scale,
+			enum wl_output_transform buffer_transform, int32_t buffer_scale,
 			struct rectangle *server_allocation)
 {
 	struct egl_window_surface *surface = to_egl_window_surface(base);
@@ -1017,7 +1017,7 @@ static const struct wl_buffer_listener shm_surface_buffer_listener = {
 static cairo_surface_t *
 shm_surface_prepare(struct toysurface *base, int dx, int dy,
 		    int32_t width, int32_t height, uint32_t flags,
-		    enum wl_output_transform buffer_transform, uint32_t buffer_scale)
+		    enum wl_output_transform buffer_transform, int32_t buffer_scale)
 {
 	int resize_hint = !!(flags & SURFACE_HINT_RESIZE);
 	struct shm_surface *surface = to_shm_surface(base);
@@ -1095,7 +1095,7 @@ out:
 
 static void
 shm_surface_swap(struct toysurface *base,
-		 enum wl_output_transform buffer_transform, uint32_t buffer_scale,
+		 enum wl_output_transform buffer_transform, int32_t buffer_scale,
 		 struct rectangle *server_allocation)
 {
 	struct shm_surface *surface = to_shm_surface(base);
@@ -1457,7 +1457,7 @@ window_set_buffer_transform(struct window *window,
 
 void
 window_set_buffer_scale(struct window *window,
-			    uint32_t scale)
+			int32_t scale)
 {
 	window->main_surface->buffer_scale = scale;
 	wl_surface_set_buffer_scale(window->main_surface->surface,
@@ -1720,7 +1720,7 @@ widget_cairo_update_transform(struct widget *widget, cairo_t *cr)
 	enum wl_output_transform transform;
 	int surface_width, surface_height;
 	int translate_x, translate_y;
-	uint32_t scale;
+	int32_t scale;
 
 	surface_width = surface->allocation.width;
 	surface_height = surface->allocation.height;
@@ -4501,7 +4501,7 @@ display_handle_done(void *data,
 static void
 display_handle_scale(void *data,
 		     struct wl_output *wl_output,
-		     uint32_t scale)
+		     int32_t scale)
 {
 	struct output *output = data;
 
diff --git a/clients/window.h b/clients/window.h
index f7b3f28..476d284 100644
--- a/clients/window.h
+++ b/clients/window.h
@@ -258,7 +258,7 @@ window_get_buffer_scale(struct window *window);
 
 void
 window_set_buffer_scale(struct window *window,
-                        uint32_t scale);
+                        int32_t scale);
 
 uint32_t
 window_get_output_scale(struct window *window);
diff --git a/src/compositor-x11.c b/src/compositor-x11.c
index 9d106a9..f386a4a 100644
--- a/src/compositor-x11.c
+++ b/src/compositor-x11.c
@@ -127,7 +127,7 @@ struct x11_output {
 	int			shm_id;
 	void		       *buf;
 	uint8_t			depth;
-	uint32_t                scale;
+	int32_t                 scale;
 };
 
 static struct xkb_keymap *
@@ -790,7 +790,7 @@ static struct x11_output *
 x11_compositor_create_output(struct x11_compositor *c, int x, int y,
 			     int width, int height, int fullscreen,
 			     int no_input, char *configured_name,
-			     uint32_t transform, uint32_t scale)
+			     uint32_t transform, int32_t scale)
 {
 	static const char name[] = "Weston Compositor";
 	static const char class[] = "weston-1\0Weston Compositor";
diff --git a/src/compositor.c b/src/compositor.c
index 4322fb8..2f09ecd 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -94,7 +94,7 @@ sigchld_handler(int signal_number, void *data)
 static void
 weston_output_transform_init(struct weston_output *output, uint32_t transform);
 static void
-weston_output_scale_init(struct weston_output *output, uint32_t scale);
+weston_output_scale_init(struct weston_output *output, int32_t scale);
 
 WL_EXPORT int
 weston_output_switch_mode(struct weston_output *output, struct weston_mode *mode)
@@ -365,7 +365,7 @@ weston_surface_to_global_float(struct weston_surface *surface,
 WL_EXPORT void
 weston_transformed_coord(int width, int height,
 			 enum wl_output_transform transform,
-			 uint32_t scale,
+			 int32_t scale,
 			 float sx, float sy, float *bx, float *by)
 {
 	switch (transform) {
@@ -411,7 +411,7 @@ weston_transformed_coord(int width, int height,
 WL_EXPORT pixman_box32_t
 weston_transformed_rect(int width, int height,
 			enum wl_output_transform transform,
-			uint32_t scale,
+			int32_t scale,
 			pixman_box32_t rect)
 {
 	float x1, x2, y1, y2;
@@ -1630,7 +1630,7 @@ surface_set_buffer_transform(struct wl_client *client,
 static void
 surface_set_buffer_scale(struct wl_client *client,
 			 struct wl_resource *resource,
-			 uint32_t scale)
+			 int32_t scale)
 {
 	struct weston_surface *surface = resource->data;
 
@@ -2669,7 +2669,7 @@ weston_output_transform_init(struct weston_output *output, uint32_t transform)
 }
 
 static void
-weston_output_scale_init(struct weston_output *output, uint32_t scale)
+weston_output_scale_init(struct weston_output *output, int32_t scale)
 {
         output->scale = scale;
 }
@@ -2689,7 +2689,7 @@ weston_output_move(struct weston_output *output, int x, int y)
 WL_EXPORT void
 weston_output_init(struct weston_output *output, struct weston_compositor *c,
 		   int x, int y, int width, int height, uint32_t transform,
-		   uint32_t scale)
+		   int32_t scale)
 {
 	output->compositor = c;
 	output->x = x;
diff --git a/src/compositor.h b/src/compositor.h
index b871fe4..a0e070f 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -183,7 +183,7 @@ struct weston_output {
 	char *make, *model, *serial_number;
 	uint32_t subpixel;
 	uint32_t transform;
-	uint32_t scale;
+	int32_t scale;
 
 	struct weston_mode *current;
 	struct weston_mode *origin;
@@ -614,7 +614,7 @@ struct weston_subsurface {
 		uint32_t buffer_transform;
 
 		/* wl_surface.set_buffer_scale */
-		uint32_t buffer_scale;
+		int32_t buffer_scale;
 	} cached;
 
 	int synchronized;
@@ -718,7 +718,7 @@ struct weston_surface {
 
 	struct weston_buffer_reference buffer_ref;
 	uint32_t buffer_transform;
-	uint32_t buffer_scale;
+	int32_t buffer_scale;
 	int keep_buffer; /* bool for backends to prevent early release */
 
 	/* All the pending state, that wl_surface.commit will apply. */
@@ -746,7 +746,7 @@ struct weston_surface {
 		uint32_t buffer_transform;
 
 		/* wl_surface.set_scaling_factor */
-		uint32_t buffer_scale;
+		int32_t buffer_scale;
 	} pending;
 
 	/*
@@ -1027,7 +1027,7 @@ void
 weston_output_move(struct weston_output *output, int x, int y);
 void
 weston_output_init(struct weston_output *output, struct weston_compositor *c,
-		   int x, int y, int width, int height, uint32_t transform, uint32_t scale);
+		   int x, int y, int width, int height, uint32_t transform, int32_t scale);
 void
 weston_output_destroy(struct weston_output *output);
 
@@ -1158,12 +1158,12 @@ module_init(struct weston_compositor *compositor,
 void
 weston_transformed_coord(int width, int height,
 			 enum wl_output_transform transform,
-			 uint32_t scale,
+			 int32_t scale,
 			 float sx, float sy, float *bx, float *by);
 pixman_box32_t
 weston_transformed_rect(int width, int height,
 			enum wl_output_transform transform,
-			uint32_t scale,
+			int32_t scale,
 			pixman_box32_t rect);
 
 #ifdef  __cplusplus
-- 
1.8.1.4



More information about the wayland-devel mailing list