[gtk+/xi2] GdkDeviceXI: X/Y could be uninitialized if these axes are ignored.
- From: Carlos Garnacho <carlosg src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+/xi2] GdkDeviceXI: X/Y could be uninitialized if these axes are ignored.
- Date: Sat, 10 Oct 2009 10:36:41 +0000 (UTC)
commit aa2c655ce29ca144d1634b021ec7a7c57c7c5b89
Author: Carlos Garnacho <carlos gnome org>
Date: Sun Oct 4 20:20:21 2009 +0200
GdkDeviceXI: X/Y could be uninitialized if these axes are ignored.
gdk/x11/gdkdevice-xi.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/gdk/x11/gdkdevice-xi.c b/gdk/x11/gdkdevice-xi.c
index 8f76a2e..d87db61 100644
--- a/gdk/x11/gdkdevice-xi.c
+++ b/gdk/x11/gdkdevice-xi.c
@@ -576,9 +576,11 @@ gdk_device_xi_translate_axes (GdkDevice *device,
{
GdkWindow *impl_window;
gdouble root_x, root_y;
+ gdouble temp_x, temp_y;
gint i;
impl_window = _gdk_window_get_impl_window (window);
+ temp_x = temp_y = 0;
if (!gdk_device_xi_get_window_info (impl_window, &root_x, &root_y))
return;
@@ -602,10 +604,10 @@ gdk_device_xi_translate_axes (GdkDevice *device,
root_x, root_y,
i, axis_data[i],
&axes[i]);
- if (x && use == GDK_AXIS_X)
- *x = axes[i];
- else if (y && use == GDK_AXIS_Y)
- *y = axes[i];
+ if (use == GDK_AXIS_X)
+ temp_x = axes[i];
+ else if (use == GDK_AXIS_Y)
+ temp_y = axes[i];
break;
default:
@@ -613,4 +615,10 @@ gdk_device_xi_translate_axes (GdkDevice *device,
break;
}
}
+
+ if (x)
+ *x = temp_x;
+
+ if (y)
+ *y = temp_y;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]