[gnome-settings-daemon] wacom: Fix compilation warnings
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] wacom: Fix compilation warnings
- Date: Wed, 18 Jan 2012 23:30:54 +0000 (UTC)
commit ccb69118a4c70b9d8aa5b4c9bdd1b0bb726498f2
Author: Bastien Nocera <hadess hadess net>
Date: Wed Jan 18 23:30:42 2012 +0000
wacom: Fix compilation warnings
plugins/wacom/gsd-wacom-device.c | 20 +++++++++++++-------
1 files changed, 13 insertions(+), 7 deletions(-)
---
diff --git a/plugins/wacom/gsd-wacom-device.c b/plugins/wacom/gsd-wacom-device.c
index 291ba49..272c975 100644
--- a/plugins/wacom/gsd-wacom-device.c
+++ b/plugins/wacom/gsd-wacom-device.c
@@ -424,12 +424,13 @@ find_output_by_edid (const gchar *vendor, const gchar *product, const gchar *ser
rr_output_info = gnome_rr_config_get_outputs (rr_config);
for (; *rr_output_info != NULL; rr_output_info++) {
- gchar o_vendor[4];
+ gchar *o_vendor;
gchar *o_product;
gchar *o_serial;
gboolean match;
- gnome_rr_output_info_get_vendor (*rr_output_info, &o_vendor);
+ o_vendor = g_malloc0 (4);
+ gnome_rr_output_info_get_vendor (*rr_output_info, o_vendor);
o_product = g_strdup_printf ("%d", gnome_rr_output_info_get_product (*rr_output_info));
o_serial = g_strdup_printf ("%d", gnome_rr_output_info_get_serial (*rr_output_info));
@@ -440,6 +441,7 @@ find_output_by_edid (const gchar *vendor, const gchar *product, const gchar *ser
(product == NULL || g_strcmp0 (product, o_product) == 0) && \
(serial == NULL || g_strcmp0 (serial, o_serial) == 0);
+ g_free (o_vendor);
g_free (o_product);
g_free (o_serial);
@@ -494,28 +496,32 @@ set_display_by_output (GsdWacomDevice *device,
GSettings *tablet;
GVariant *c_array;
GVariant *n_array;
- const char **display;
gsize nvalues;
- gchar o_vendor[4], *o_product, *o_serial;
+ gchar *o_vendor, *o_product, *o_serial;
const gchar *values[3];
tablet = gsd_wacom_device_get_settings (device);
c_array = g_settings_get_value (tablet, "display");
- display = g_variant_get_strv (c_array, &nvalues);
+ g_variant_get_strv (c_array, &nvalues);
if (nvalues != 3) {
g_warning("Unable set set display property. Got %"G_GSIZE_FORMAT" items; expected %d items.\n", nvalues, 4);
return;
}
- gnome_rr_output_info_get_vendor (rr_output_info, &o_vendor);
+ o_vendor = g_malloc0 (4);
+ gnome_rr_output_info_get_vendor (rr_output_info, o_vendor);
o_product = g_strdup_printf ("%d", gnome_rr_output_info_get_product (rr_output_info));
o_serial = g_strdup_printf ("%d", gnome_rr_output_info_get_serial (rr_output_info));
values[0] = o_vendor;
values[1] = o_product;
values[2] = o_serial;
- n_array = g_variant_new_strv(&values, 3);
+ n_array = g_variant_new_strv((const gchar * const *) &values, 3);
g_settings_set_value (tablet, "display", n_array);
+
+ g_free (o_vendor);
+ g_free (o_product);
+ g_free (o_serial);
}
static GnomeRROutputInfo*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]