From 29aad9fe1113f6b5586e86aa4cc9d7d25c23d361 Mon Sep 17 00:00:00 2001
From: Cyrille Bagard <nocbos@gmail.com>
Date: Mon, 30 May 2016 23:35:38 +0200
Subject: Avoided errors on project saving.

---
 ChangeLog             |  5 +++++
 src/analysis/binary.c | 27 ++++++++++++++++++---------
 2 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index c448c35..a94e7c1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 16-05-30  Cyrille Bagard <nocbos@gmail.com>
 
+	* src/analysis/binary.c:
+	Avoid errors on project saving.
+
+16-05-30  Cyrille Bagard <nocbos@gmail.com>
+
 	* plugins/pychrysa/format/format.c:
 	* src/analysis/disass/links.c:
 	* src/analysis/disass/links.h:
diff --git a/src/analysis/binary.c b/src/analysis/binary.c
index 8957399..20410f2 100644
--- a/src/analysis/binary.c
+++ b/src/analysis/binary.c
@@ -207,9 +207,10 @@ static void g_loaded_binary_init(GLoadedBinary *binary)
     binary->remote_host = strdup("localhost");
     binary->remote_port = 1337;
 
+    binary->storages[DBF_BOOKMARKS] = DBS_ALL_LOCAL;
     binary->storages[DBF_COMMENTS] = DBS_ALL_LOCAL;
+    binary->storages[DBF_MOVES] = DBS_ALL_LOCAL;
     binary->storages[DBF_DISPLAY_SWITCHERS] = DBS_ALL_LOCAL;
-    binary->storages[DBF_BOOKMARKS] = DBS_ALL_LOCAL;
 
     binary->collections = create_collections_list();
     attach_binary_to_collections(binary->collections, binary);
@@ -684,17 +685,21 @@ static bool g_loaded_binary_load_storage(GLoadedBinary *binary, xmlXPathContextP
 
         switch (i)
         {
+            case DBF_BOOKMARKS:
+                access = stradd(access, "Bookmarks");
+                break;
             case DBF_COMMENTS:
                 access = stradd(access, "Comments");
                 break;
+            case DBF_MOVES:
+                access = stradd(access, "Moves");
+                break;
             case DBF_DISPLAY_SWITCHERS:
                 access = stradd(access, "Segments");
                 break;
-            case DBF_BOOKMARKS:
-                access = stradd(access, "Bookmarks");
-                break;
-            case DBF_COUNT:
+            default:
                 /* Pour GCC */
+                assert(false);
                 break;
         }
 
@@ -781,17 +786,21 @@ static bool g_loaded_binary_save_storage(const GLoadedBinary *binary, xmlDocPtr
 
         switch (i)
         {
+            case DBF_BOOKMARKS:
+                access = stradd(access, "Bookmarks");
+                break;
             case DBF_COMMENTS:
                 access = stradd(access, "Comments");
                 break;
+            case DBF_MOVES:
+                access = stradd(access, "Moves");
+                break;
             case DBF_DISPLAY_SWITCHERS:
                 access = stradd(access, "Segments");
                 break;
-            case DBF_BOOKMARKS:
-                access = stradd(access, "Bookmarks");
-                break;
-            case DBF_COUNT:
+            default:
                 /* Pour GCC */
+                assert(false);
                 break;
         }
 
-- 
cgit v0.11.2-87-g4458