Re: [PATCH] clients: Initialize label in keyboard handling code

2014-05-09 Thread Kristian Høgsberg
On Wed, May 07, 2014 at 01:11:07AM +, Bryce W. Harrington wrote:
 Quells warning:
   clients/keyboard.c: In function ‘keyboard_handle_key.isra.5’:
   clients/keyboard.c:556:11: warning: ‘label’ may be used uninitialized in
   this function [-Wuninitialized]
 
 Signed-off-by: Bryce Harrington b.harring...@samsung.com

Thanks Bryce, patch applied.

Kristian

 ---
  clients/keyboard.c |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/clients/keyboard.c b/clients/keyboard.c
 index cd1ad58..7c11cec 100644
 --- a/clients/keyboard.c
 +++ b/clients/keyboard.c
 @@ -530,7 +530,7 @@ append(char *s1, const char *s2)
  static void
  keyboard_handle_key(struct keyboard *keyboard, uint32_t time, const struct 
 key *key, struct input *input, enum wl_pointer_button_state state)
  {
 - const char *label;
 + const char *label = NULL;
  
   switch(keyboard-state) {
   case KEYBOARD_STATE_DEFAULT :
 -- 
 1.7.9.5
 ___
 wayland-devel mailing list
 wayland-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/wayland-devel
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH] clients: Initialize label in keyboard handling code

2014-05-07 Thread Pekka Paalanen
On Wed, 07 May 2014 01:11:07 +
Bryce W. Harrington b.harring...@samsung.com wrote:

 Quells warning:
   clients/keyboard.c: In function ‘keyboard_handle_key.isra.5’:
   clients/keyboard.c:556:11: warning: ‘label’ may be used
 uninitialized in this function [-Wuninitialized]
 
 Signed-off-by: Bryce Harrington b.harring...@samsung.com
 ---
  clients/keyboard.c |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/clients/keyboard.c b/clients/keyboard.c
 index cd1ad58..7c11cec 100644
 --- a/clients/keyboard.c
 +++ b/clients/keyboard.c
 @@ -530,7 +530,7 @@ append(char *s1, const char *s2)
  static void
  keyboard_handle_key(struct keyboard *keyboard, uint32_t time, const
 struct key *key, struct input *input, enum wl_pointer_button_state
 state) {
 - const char *label;
 + const char *label = NULL;
  
   switch(keyboard-state) {
   case KEYBOARD_STATE_DEFAULT :

Yeah, I've seen this warning, it's almost a false positive, but nice to
shut it up, anyway.


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


[PATCH] clients: Initialize label in keyboard handling code

2014-05-06 Thread Bryce W. Harrington
Quells warning:
  clients/keyboard.c: In function ‘keyboard_handle_key.isra.5’:
  clients/keyboard.c:556:11: warning: ‘label’ may be used uninitialized in
  this function [-Wuninitialized]

Signed-off-by: Bryce Harrington b.harring...@samsung.com
---
 clients/keyboard.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clients/keyboard.c b/clients/keyboard.c
index cd1ad58..7c11cec 100644
--- a/clients/keyboard.c
+++ b/clients/keyboard.c
@@ -530,7 +530,7 @@ append(char *s1, const char *s2)
 static void
 keyboard_handle_key(struct keyboard *keyboard, uint32_t time, const struct key 
*key, struct input *input, enum wl_pointer_button_state state)
 {
-   const char *label;
+   const char *label = NULL;
 
switch(keyboard-state) {
case KEYBOARD_STATE_DEFAULT :
-- 
1.7.9.5
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel