[clutter] input: Add a check on the argument
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] input: Add a check on the argument
- Date: Thu, 1 Mar 2012 15:12:47 +0000 (UTC)
commit 251d3b545e4df6c55dd596424dda3470564f16cf
Author: Emmanuele Bassi <ebassi linux intel com>
Date: Thu Mar 1 15:11:59 2012 +0000
input: Add a check on the argument
clutter/clutter-input-device.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/clutter/clutter-input-device.c b/clutter/clutter-input-device.c
index efec797..41196ee 100644
--- a/clutter/clutter-input-device.c
+++ b/clutter/clutter-input-device.c
@@ -1421,9 +1421,10 @@ _clutter_input_device_select_stage_events (ClutterInputDevice *device,
* equivalent evdev keycode. Note that depending on the input backend
* used by Clutter this function can fail if there is no obvious
* mapping between the key codes. The hardware keycode can be taken
- * from the hardware_keycode member of #ClutterKeyEvent.
+ * from the #ClutterKeyEvent.hardware_keycode member of #ClutterKeyEvent.
*
* Return value: %TRUE if the conversion succeeded, %FALSE otherwise.
+ *
* Since: 1.10
*/
gboolean
@@ -1433,6 +1434,8 @@ clutter_input_device_keycode_to_evdev (ClutterInputDevice *device,
{
ClutterInputDeviceClass *device_class;
+ g_return_val_if_fail (CLUTTER_IS_INPUT_DEVICE (device), FALSE);
+
device_class = CLUTTER_INPUT_DEVICE_GET_CLASS (device);
if (device_class->keycode_to_evdev == NULL)
return FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]