diff options
author | Ryan Lortie <desrt@desrt.ca> | 2011-09-12 08:13:25 -0400 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2011-09-12 08:13:25 -0400 |
commit | a4919e5a81bb1a430eb2ae4242b81c4c9d681047 (patch) | |
tree | 6ad96a800924c7633b296e46988615a720fe1770 /gvdb | |
parent | 44d56d869d2236ef1d177bd1ab33d65ae23d7e2e (diff) | |
parent | 92652ac79177bcdced5f01122debb50eabdb3e2c (diff) | |
download | dconf-a4919e5a81bb1a430eb2ae4242b81c4c9d681047.tar.gz |
Merge remote-tracking branch 'gvdb/master'
Diffstat (limited to 'gvdb')
-rw-r--r-- | gvdb/gvdb-builder.c | 4 | ||||
-rw-r--r-- | gvdb/gvdb-reader.c | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/gvdb/gvdb-builder.c b/gvdb/gvdb-builder.c index 4b48d80..91adec6 100644 --- a/gvdb/gvdb-builder.c +++ b/gvdb/gvdb-builder.c @@ -24,7 +24,9 @@ #include <glib.h> #include <fcntl.h> +#if !defined(G_OS_WIN32) || !defined(_MSC_VER) #include <unistd.h> +#endif #include <string.h> @@ -91,7 +93,7 @@ djb_hash (const gchar *key) guint32 hash_value = 5381; while (*key) - hash_value = hash_value * 33 + *key++; + hash_value = hash_value * 33 + *(signed char *)key++; return hash_value; } diff --git a/gvdb/gvdb-reader.c b/gvdb/gvdb-reader.c index 73f4f13..57816af 100644 --- a/gvdb/gvdb-reader.c +++ b/gvdb/gvdb-reader.c @@ -254,7 +254,7 @@ gvdb_table_lookup (GvdbTable *file, return NULL; for (key_length = 0; key[key_length]; key_length++) - hash_value = (hash_value * 33) + key[key_length]; + hash_value = (hash_value * 33) + ((signed char *) key)[key_length]; if (!gvdb_table_bloom_filter (file, hash_value)) return NULL; |