[gnome-settings-daemon] wacom: Don't use uninitialized or stale values for has_oled



commit 4b2ccce6d409837f0f3fe597ff8178e5a3555915
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Tue Sep 3 17:20:51 2013 -0400

    wacom: Don't use uninitialized or stale values for has_oled
    
    has_oled isn't scoped to the body of the loop, so we need to always
    set it.

 plugins/wacom/gsd-wacom-device.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/plugins/wacom/gsd-wacom-device.c b/plugins/wacom/gsd-wacom-device.c
index 32a3f4b..918363f 100644
--- a/plugins/wacom/gsd-wacom-device.c
+++ b/plugins/wacom/gsd-wacom-device.c
@@ -1271,8 +1271,7 @@ gsd_wacom_device_add_buttons_dir (WacomDevice      *wacom_device,
 
                name = g_strdup_printf (button_str, button_num++);
                id = g_strdup_printf ("%s%c", button_str_id, i);
-               if (libwacom_get_button_flag (wacom_device, i) & WACOM_BUTTON_OLED)
-                       has_oled = TRUE;
+               has_oled = (libwacom_get_button_flag (wacom_device, i) & WACOM_BUTTON_OLED) != 0;
                l = g_list_append (l, gsd_wacom_tablet_button_new (name,
                                                                   id,
                                                                   settings_path,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]