From 667222c301ca0f19c570938055208e564e4d02ef Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Thu, 11 Feb 2010 15:08:19 +0000 Subject: [PATCH] analysis: ClutterAnimator/1 Do not de-reference a void*; use a temporary variable -- after checking the contents of the pointer. This actually simplifies the readability and avoids pulling a Lisp with the parentheses. --- clutter/clutter-animator.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/clutter/clutter-animator.c b/clutter/clutter-animator.c index 31b9c61..d9d98ec 100644 --- a/clutter/clutter-animator.c +++ b/clutter/clutter-animator.c @@ -551,6 +551,7 @@ static gfloat list_try_get_rel (GList *list, gint count) { + ClutterAnimatorKey *key; GList *iter = list; GList *best = list; @@ -575,7 +576,14 @@ list_try_get_rel (GList *list, } } - return g_value_get_float (&(((ClutterAnimatorKey *)best->data)->value)); + if (best != NULL && best->data != NULL) + { + key = best->data; + + return g_value_get_float (&(key->value)); + } + + return 0; } static void -- 2.7.4