[glib/new-gsettings] gvdb file format tweak



commit 74caa8592dcb9a67b7cc10cec74c5d7b900fbf47
Author: Ryan Lortie <desrt desrt ca>
Date:   Wed Apr 14 19:50:05 2010 -0400

    gvdb file format tweak

 gio/gvdb/gvdb-builder.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/gio/gvdb/gvdb-builder.c b/gio/gvdb/gvdb-builder.c
index a947cee..a59772b 100644
--- a/gio/gvdb/gvdb-builder.c
+++ b/gio/gvdb/gvdb-builder.c
@@ -364,15 +364,17 @@ file_builder_add_hash (FileBuilder         *fb,
   file_builder_allocate_for_hash (fb, mytable->n_buckets, index, 5, 0,
                                   &bloom_filter, &buckets, &items, pointer);
 
+  index = 0;
   for (bucket = 0; bucket < mytable->n_buckets; bucket++)
     {
-      buckets[bucket] = item_to_index (mytable->buckets[bucket]);
+      buckets[bucket] = guint32_to_le (index);
 
       for (item = mytable->buckets[bucket]; item; item = item->next)
         {
           struct gvdb_hash_item *entry = items++;
           const gchar *basename;
 
+          g_assert (index == guint32_from_le (item->assigned_index));
           entry->hash_value = guint32_to_le (item->hash_value);
           entry->parent = item_to_index (item->parent);
           entry->unused = 0;
@@ -421,6 +423,8 @@ file_builder_add_hash (FileBuilder         *fb,
               entry->type = 'H';
               file_builder_add_hash (fb, item->table, &entry->value.pointer);
             }
+
+          index++;
         }
     }
 }



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