aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-text-index.c
diff options
context:
space:
mode:
Diffstat (limited to 'camel/camel-text-index.c')
-rw-r--r--camel/camel-text-index.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/camel/camel-text-index.c b/camel/camel-text-index.c
index dfc85a1f55..57c9bcaeef 100644
--- a/camel/camel-text-index.c
+++ b/camel/camel-text-index.c
@@ -427,7 +427,7 @@ text_index_compress_nosync(CamelIndex *idx)
goto fail;
rb->names++;
camel_partition_table_add(newp->name_hash, name, newkeyid);
- g_hash_table_insert(remap, (void *)oldkeyid, (void *)newkeyid);
+ g_hash_table_insert(remap, GINT_TO_POINTER(oldkeyid), GINT_TO_POINTER(newkeyid));
} else
io(printf("deleted name '%s'\n", name));
g_free(name);
@@ -453,7 +453,7 @@ text_index_compress_nosync(CamelIndex *idx)
goto fail;
}
for (i=0;i<count;i++) {
- newkeyid = (camel_key_t)g_hash_table_lookup(remap, (void *)records[i]);
+ newkeyid = (camel_key_t)GPOINTER_TO_INT(g_hash_table_lookup(remap, GINT_TO_POINTER(records[i])));
if (newkeyid) {
newrecords[newcount++] = newkeyid;
if (newcount == sizeof(newrecords)/sizeof(newrecords[0])) {
@@ -1275,16 +1275,16 @@ camel_text_index_validate(CamelTextIndex *idx)
keyid = 0;
while ( (keyid = camel_key_table_next(p->name_index, keyid, &word, &flags, &data)) ) {
- if ((oldword = g_hash_table_lookup(names, (void *)keyid)) != NULL
- || (oldword = g_hash_table_lookup(deleted, (void *)keyid)) != NULL) {
+ if ((oldword = g_hash_table_lookup(names, GINT_TO_POINTER(keyid))) != NULL
+ || (oldword = g_hash_table_lookup(deleted, GINT_TO_POINTER(keyid))) != NULL) {
printf("Warning, name '%s' duplicates key (%x) with name '%s'\n", word, keyid, oldword);
g_free(word);
} else {
g_hash_table_insert(name_word, word, (void *)1);
if ((flags & 1) == 0) {
- g_hash_table_insert(names, (void *)keyid, word);
+ g_hash_table_insert(names, GINT_TO_POINTER(keyid), word);
} else {
- g_hash_table_insert(deleted, (void *)keyid, word);
+ g_hash_table_insert(deleted, GINT_TO_POINTER(keyid), word);
}
}
}
@@ -1297,12 +1297,12 @@ camel_text_index_validate(CamelTextIndex *idx)
GHashTable *used;
/* first, check for duplicates of keyid, and data */
- if ((oldword = g_hash_table_lookup(words, (void *)keyid)) != NULL) {
+ if ((oldword = g_hash_table_lookup(words, GINT_TO_POINTER(keyid))) != NULL) {
printf("Warning, word '%s' duplicates key (%x) with name '%s'\n", word, keyid, oldword);
g_free(word);
word = oldword;
} else {
- g_hash_table_insert(words, (void *)keyid, word);
+ g_hash_table_insert(words, GINT_TO_POINTER(keyid), word);
}
if (data == 0) {
@@ -1310,10 +1310,10 @@ camel_text_index_validate(CamelTextIndex *idx)
though it is a problem if its a fresh index */
printf("Word '%s' has no data associated with it\n", word);
} else {
- if ((oldword = g_hash_table_lookup(keys, (void *)data)) != NULL) {
+ if ((oldword = g_hash_table_lookup(keys, GUINT_TO_POINTER(data))) != NULL) {
printf("Warning, word '%s' duplicates data (%x) with name '%s'\n", word, data, oldword);
} else {
- g_hash_table_insert(keys, (void *)data, word);
+ g_hash_table_insert(keys, GUINT_TO_POINTER(data), word);
}
}