Re: [PATCH weston] screenshooter: silence a warning

2014-01-08 Thread Kristian Høgsberg
On Wed, Jan 08, 2014 at 03:39:18PM +0200, ppaala...@gmail.com wrote:
> From: Pekka Paalanen 
> 
> screenshooter.c: In function ‘recorder_binding’:
> screenshooter.c:509:5: warning: ‘listener’ may be used uninitialized in
> this function [-Wuninitialized]
> 
> This was not really a problem so far, because the variable was
> uninitialized only in the case where Weston had no outputs.

Patch applied, warning silenced.  Thanks.

Kristian

> Signed-off-by: Pekka Paalanen 
> ---
>  src/screenshooter.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/screenshooter.c b/src/screenshooter.c
> index 0489f92..26e503c 100644
> --- a/src/screenshooter.c
> +++ b/src/screenshooter.c
> @@ -495,7 +495,7 @@ recorder_binding(struct weston_seat *seat, uint32_t time, 
> uint32_t key, void *da
>   struct weston_seat *ws = (struct weston_seat *) seat;
>   struct weston_compositor *ec = ws->compositor;
>   struct weston_output *output;
> - struct wl_listener *listener;
> + struct wl_listener *listener = NULL;
>   struct weston_recorder *recorder;
>   static const char filename[] = "capture.wcap";
>  
> -- 
> 1.8.3.2
> 
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston] screenshooter: silence a warning

2014-01-08 Thread ppaalanen
From: Pekka Paalanen 

screenshooter.c: In function ‘recorder_binding’:
screenshooter.c:509:5: warning: ‘listener’ may be used uninitialized in
this function [-Wuninitialized]

This was not really a problem so far, because the variable was
uninitialized only in the case where Weston had no outputs.

Signed-off-by: Pekka Paalanen 
---
 src/screenshooter.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/screenshooter.c b/src/screenshooter.c
index 0489f92..26e503c 100644
--- a/src/screenshooter.c
+++ b/src/screenshooter.c
@@ -495,7 +495,7 @@ recorder_binding(struct weston_seat *seat, uint32_t time, 
uint32_t key, void *da
struct weston_seat *ws = (struct weston_seat *) seat;
struct weston_compositor *ec = ws->compositor;
struct weston_output *output;
-   struct wl_listener *listener;
+   struct wl_listener *listener = NULL;
struct weston_recorder *recorder;
static const char filename[] = "capture.wcap";
 
-- 
1.8.3.2

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel