[PATCH] compositor-wayland: Fix compiler warning

Kristian Høgsberg hoegsberg at gmail.com
Wed Jun 18 16:29:10 PDT 2014


On Tue, May 27, 2014 at 09:08:29AM +0200, Thierry Reding wrote:
> From: Thierry Reding <treding at nvidia.com>
> 
> sizeof returns size_t, for which the correct printf specifier is %zu.
> Fixes the following warning when building for ARMv7.
> 
> 	src/compositor-wayland.c: In function 'wayland_output_get_shm_buffer':
> 	src/compositor-wayland.c:260:3: warning: format '%ld' expects argument of type 'long int', but argument 2 has type 'unsigned int' [-Wformat=]
> 	   weston_log("could not zalloc %ld memory for sb: %m\n", sizeof *sb);
> 	   ^
> 
> Signed-off-by: Thierry Reding <treding at nvidia.com>

Thanks, patch applied.

Kristian

> ---
>  src/compositor-wayland.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c
> index 76e5396f4215..a4dcec272233 100644
> --- a/src/compositor-wayland.c
> +++ b/src/compositor-wayland.c
> @@ -257,7 +257,7 @@ wayland_output_get_shm_buffer(struct wayland_output *output)
>  
>  	sb = zalloc(sizeof *sb);
>  	if (sb == NULL) {
> -		weston_log("could not zalloc %ld memory for sb: %m\n", sizeof *sb);
> +		weston_log("could not zalloc %zu memory for sb: %m\n", sizeof *sb);
>  		close(fd);
>  		free(data);
>  		return NULL;
> -- 
> 1.9.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