aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-vee-folder.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2004-02-04 12:07:39 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2004-02-04 12:07:39 +0800
commit81ea466c6ae4b3d465f9921257a16cf584676f1b (patch)
treeaf5b61e6c81524865cdec644910fafe53069206e /camel/camel-vee-folder.c
parentc16b5e3a40e4624db26826dfa6d4f3506278305b (diff)
downloadgsoc2013-evolution-81ea466c6ae4b3d465f9921257a16cf584676f1b.tar.gz
gsoc2013-evolution-81ea466c6ae4b3d465f9921257a16cf584676f1b.tar.zst
gsoc2013-evolution-81ea466c6ae4b3d465f9921257a16cf584676f1b.zip
Use macro casts from int to pointer.
2004-02-03 Jeffrey Stedfast <fejj@ximian.com> * camel-vee-folder.c (vee_folder_build_folder): Use macro casts from int to pointer. * camel-folder.c (camel_folder_change_info_add_source): Same as below. (camel_folder_change_info_add_source_list): Same. * camel-folder-search.c (camel_folder_search_execute_expression): Use GINT_TO_POINTER() to cast 1 to a pointer for g_hash_table_insert(). * camel-vee-folder.c (vee_folder_remove_folder): 64bit fixes. (folder_added_uid): Same. (vee_folder_build_folder): Here too. (folder_changed_add_uid): And here. (folder_changed_remove_uid): Same. svn path=/trunk/; revision=24597
Diffstat (limited to 'camel/camel-vee-folder.c')
-rw-r--r--camel/camel-vee-folder.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/camel/camel-vee-folder.c b/camel/camel-vee-folder.c
index f7ceb12d59..e9f6e145f9 100644
--- a/camel/camel-vee-folder.c
+++ b/camel/camel-vee-folder.c
@@ -895,7 +895,8 @@ vee_folder_remove_folder(CamelVeeFolder *vf, CamelFolder *source, int killun)
char hash[8];
/*struct _CamelVeeFolderPrivate *p = _PRIVATE(vf);*/
CamelFolderChangeInfo *vf_changes = NULL, *unmatched_changes = NULL;
-
+ gpointer oldval;
+
if (vf == folder_unmatched)
return;
@@ -962,7 +963,8 @@ vee_folder_remove_folder(CamelVeeFolder *vf, CamelFolder *source, int killun)
}
if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0) {
if (still) {
- if (g_hash_table_lookup_extended(unmatched_uids, uid, (void **)&oldkey, (void **)&n)) {
+ if (g_hash_table_lookup_extended(unmatched_uids, uid, (void **)&oldkey, &oldval)) {
+ n = GPOINTER_TO_INT (oldval);
if (n == 1) {
g_hash_table_remove(unmatched_uids, oldkey);
if (vee_folder_add_uid(folder_unmatched, source, oldkey+8, hash))
@@ -973,7 +975,7 @@ vee_folder_remove_folder(CamelVeeFolder *vf, CamelFolder *source, int killun)
}
}
} else {
- if (g_hash_table_lookup_extended(unmatched_uids, camel_message_info_uid(mi), (void **)&oldkey, (void **)&n)) {
+ if (g_hash_table_lookup_extended(unmatched_uids, camel_message_info_uid(mi), (void **)&oldkey, &oldval)) {
g_hash_table_remove(unmatched_uids, oldkey);
g_free(oldkey);
}
@@ -1044,6 +1046,7 @@ static void
folder_added_uid(char *uidin, void *value, struct _update_data *u)
{
CamelVeeMessageInfo *mi;
+ gpointer oldval;
char *oldkey;
int n;
@@ -1051,7 +1054,8 @@ folder_added_uid(char *uidin, void *value, struct _update_data *u)
camel_folder_change_info_add_uid(u->vf->changes, camel_message_info_uid(mi));
if (!CAMEL_IS_VEE_FOLDER(u->source)) {
- if (g_hash_table_lookup_extended(unmatched_uids, camel_message_info_uid(mi), (void **)&oldkey, (void **)&n)) {
+ if (g_hash_table_lookup_extended(unmatched_uids, camel_message_info_uid(mi), (void **)&oldkey, &oldval)) {
+ n = GPOINTER_TO_INT (oldval);
g_hash_table_insert(unmatched_uids, oldkey, GINT_TO_POINTER(n+1));
} else {
g_hash_table_insert(unmatched_uids, g_strdup(camel_message_info_uid(mi)), GINT_TO_POINTER(1));
@@ -1094,13 +1098,13 @@ vee_folder_build_folder(CamelVeeFolder *vf, CamelFolder *source, CamelException
we just ref the real memory */
matchhash = g_hash_table_new(g_str_hash, g_str_equal);
for (i=0;i<match->len;i++)
- g_hash_table_insert(matchhash, match->pdata[i], (void *)1);
+ g_hash_table_insert(matchhash, match->pdata[i], GINT_TO_POINTER (1));
allhash = g_hash_table_new(g_str_hash, g_str_equal);
all = camel_folder_get_uids(f);
for (i=0;i<all->len;i++)
if (g_hash_table_lookup(matchhash, all->pdata[i]) == NULL)
- g_hash_table_insert(allhash, all->pdata[i], (void *)1);
+ g_hash_table_insert(allhash, all->pdata[i], GINT_TO_POINTER (1));
CAMEL_VEE_FOLDER_LOCK(folder_unmatched, summary_lock);
@@ -1114,7 +1118,8 @@ vee_folder_build_folder(CamelVeeFolder *vf, CamelFolder *source, CamelException
if (mi) {
if (mi->folder == source) {
char *uid = (char *)camel_message_info_uid(mi), *oldkey;
-
+ gpointer oldval;
+
if (g_hash_table_lookup(matchhash, uid+8) == NULL) {
if (last == -1) {
last = start = i;
@@ -1127,7 +1132,8 @@ vee_folder_build_folder(CamelVeeFolder *vf, CamelFolder *source, CamelException
}
camel_folder_change_info_remove_uid(vf->changes, camel_message_info_uid(mi));
if (!CAMEL_IS_VEE_FOLDER(source)
- && g_hash_table_lookup_extended(unmatched_uids, uid, (void **)&oldkey, (void **)&n)) {
+ && g_hash_table_lookup_extended(unmatched_uids, uid, (void **)&oldkey, &oldval)) {
+ n = GPOINTER_TO_INT (oldval);
if (n == 1) {
g_hash_table_remove(unmatched_uids, oldkey);
g_free(oldkey);
@@ -1223,6 +1229,7 @@ folder_changed_add_uid(CamelFolder *sub, const char *uid, const char hash[8], Ca
{
CamelVeeMessageInfo *vinfo;
const char *vuid;
+ gpointer oldval;
char *oldkey;
int n;
@@ -1234,10 +1241,11 @@ folder_changed_add_uid(CamelFolder *sub, const char *uid, const char hash[8], Ca
camel_folder_change_info_add_uid(vf->changes, vuid);
if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0 && !CAMEL_IS_VEE_FOLDER(sub)) {
- if (g_hash_table_lookup_extended(unmatched_uids, vuid, (void **)&oldkey, (void **)&n)) {
+ if (g_hash_table_lookup_extended(unmatched_uids, vuid, (void **)&oldkey, &oldval)) {
+ n = GPOINTER_TO_INT (oldval);
g_hash_table_insert(unmatched_uids, oldkey, GINT_TO_POINTER(n+1));
} else {
- g_hash_table_insert(unmatched_uids, g_strdup(vuid), (void *)1);
+ g_hash_table_insert(unmatched_uids, g_strdup(vuid), GINT_TO_POINTER (1));
}
vinfo = (CamelVeeMessageInfo *)camel_folder_get_message_info((CamelFolder *)folder_unmatched, vuid);
if (vinfo) {
@@ -1253,6 +1261,7 @@ folder_changed_remove_uid(CamelFolder *sub, const char *uid, const char hash[8],
{
CamelFolder *folder = (CamelFolder *)vf;
char *vuid, *oldkey;
+ gpointer oldval;
int n;
CamelVeeMessageInfo *vinfo;
@@ -1269,7 +1278,8 @@ folder_changed_remove_uid(CamelFolder *sub, const char *uid, const char hash[8],
if ((vf->flags & CAMEL_STORE_FOLDER_PRIVATE) == 0 && !CAMEL_IS_VEE_FOLDER(sub)) {
if (keep) {
- if (g_hash_table_lookup_extended(unmatched_uids, vuid, (void **)&oldkey, (void **)&n)) {
+ if (g_hash_table_lookup_extended(unmatched_uids, vuid, (void **)&oldkey, &oldval)) {
+ n = GPOINTER_TO_INT (oldval);
if (n == 1) {
g_hash_table_remove(unmatched_uids, oldkey);
if (vee_folder_add_uid(folder_unmatched, sub, uid, hash))
@@ -1283,7 +1293,7 @@ folder_changed_remove_uid(CamelFolder *sub, const char *uid, const char hash[8],
camel_folder_change_info_add_uid(folder_unmatched->changes, oldkey);
}
} else {
- if (g_hash_table_lookup_extended(unmatched_uids, vuid, (void **)&oldkey, (void **)&n)) {
+ if (g_hash_table_lookup_extended(unmatched_uids, vuid, (void **)&oldkey, &oldval)) {
g_hash_table_remove(unmatched_uids, oldkey);
g_free(oldkey);
}