[frogr] Fix unitialized values



commit 24633f03fea40565d3ca7473eb91f75d9b7de848
Author: Mario Sanchez Prada <msanchez gnome org>
Date:   Sat Dec 22 07:18:18 2012 +0100

    Fix unitialized values

 src/frogr-main-view.c |    8 ++------
 src/frogr-model.c     |    2 +-
 2 files changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/src/frogr-main-view.c b/src/frogr-main-view.c
index 7389ae8..ed6a8c6 100644
--- a/src/frogr-main-view.c
+++ b/src/frogr-main-view.c
@@ -703,18 +703,14 @@ _on_radio_menu_item_changed (GSimpleAction *action, GVariant *parameter, gpointe
     }
   else if (!g_strcmp0 (action_name, ACTION_SORT_BY))
     {
-      SortingCriteria criteria;
+      SortingCriteria criteria = SORT_AS_LOADED;
 
-      if (!g_strcmp0 (target, ACTION_SORT_BY_TARGET_AS_LOADED))
-        criteria = SORT_AS_LOADED;
-      else if (!g_strcmp0 (target, ACTION_SORT_BY_TARGET_DATE_TAKEN))
+      if (!g_strcmp0 (target, ACTION_SORT_BY_TARGET_DATE_TAKEN))
         criteria = SORT_BY_DATE;
       else if (!g_strcmp0 (target, ACTION_SORT_BY_TARGET_TITLE))
         criteria = SORT_BY_TITLE;
       else if (!g_strcmp0 (target, ACTION_SORT_BY_TARGET_SIZE))
         criteria = SORT_BY_SIZE;
-      else
-        g_assert_not_reached ();
 
       /* Update the UI and save settings */
       _reorder_pictures (FROGR_MAIN_VIEW (data), criteria, priv->sorting_reversed);
diff --git a/src/frogr-model.c b/src/frogr-model.c
index 9d6d035..891a81a 100644
--- a/src/frogr-model.c
+++ b/src/frogr-model.c
@@ -293,7 +293,7 @@ _deserialize_list_from_json_array (JsonArray *array, GType g_type)
 {
   JsonNode *json_node = NULL;
   GSList *result_list = NULL;
-  gpointer element;
+  gpointer element = NULL;
   guint n_elements = 0;
   guint i = 0;
 



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