[PATCH weston 1/2] simple-egl: Fix -Wsign-compare compiler warning

Kristian Høgsberg hoegsberg at gmail.com
Mon Jan 27 21:13:36 PST 2014


On Fri, Jan 03, 2014 at 07:46:50PM +0100, Jonas Ådahl wrote:
> Fixes the following compiler warning:
> 
> simple-egl.c:434:36: warning: comparison between signed and unsigned
> integer expressions [-Wsign-compare]
> 
> Signed-off-by: Jonas Ådahl <jadahl at gmail.com>
> ---
>  clients/simple-egl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/clients/simple-egl.c b/clients/simple-egl.c
> index 2c009ee..5b0393e 100644
> --- a/clients/simple-egl.c
> +++ b/clients/simple-egl.c
> @@ -412,7 +412,7 @@ redraw(void *data, struct wl_callback *callback, uint32_t time)
>  		{ 0, 0, 1, 0 },
>  		{ 0, 0, 0, 1 }
>  	};
> -	static const int32_t speed_div = 5, benchmark_interval = 5;
> +	static const uint32_t speed_div = 5, benchmark_interval = 5;

That also makes the integer overflow used in the benchmark logic
unsigned and thus well-defined.

Thanks, applied.

Kristian


>  	struct wl_region *region;
>  	EGLint rect[4];
>  	EGLint buffer_age = 0;
> -- 
> 1.8.3.2
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list