evolution-mapi r33 - in trunk/src: account-setup-eplugin calendar camel libexchangemapi



Author: mbarnes
Date: Tue Dec 16 17:23:40 2008
New Revision: 33
URL: http://svn.gnome.org/viewvc/evolution-mapi?rev=33&view=rev

Log:
Fix a bunch of compiler warnings (bug #564553).


Modified:
   trunk/src/account-setup-eplugin/ChangeLog
   trunk/src/account-setup-eplugin/exchange-mapi-account-setup.c
   trunk/src/calendar/ChangeLog
   trunk/src/calendar/e-cal-backend-mapi.c
   trunk/src/camel/ChangeLog
   trunk/src/camel/camel-mapi-folder.c
   trunk/src/camel/camel-mapi-store.c
   trunk/src/camel/camel-mapi-transport.c
   trunk/src/libexchangemapi/ChangeLog
   trunk/src/libexchangemapi/exchange-mapi-cal-utils.c
   trunk/src/libexchangemapi/exchange-mapi-connection.c

Modified: trunk/src/account-setup-eplugin/exchange-mapi-account-setup.c
==============================================================================
--- trunk/src/account-setup-eplugin/exchange-mapi-account-setup.c	(original)
+++ trunk/src/account-setup-eplugin/exchange-mapi-account-setup.c	Tue Dec 16 17:23:40 2008
@@ -380,10 +380,13 @@
 static gboolean
 check_node (GtkTreeStore *ts, ExchangeMAPIFolder *folder, GtkTreeIter *iter)
 {
+	GtkTreeModel *ts_model;
 	mapi_id_t fid;
 	gboolean status = FALSE;
+
+	ts_model = GTK_TREE_MODEL (ts);
 	
-	gtk_tree_model_get (GTK_TREE_MODEL (ts), iter, 1, &fid, -1);
+	gtk_tree_model_get (ts_model, iter, 1, &fid, -1);
 	if (fid && folder->parent_folder_id == fid) {
 		/* Do something */
 		GtkTreeIter node;
@@ -392,13 +395,13 @@
 		return TRUE;
 	}
 
-	if (gtk_tree_model_iter_has_child (ts, iter)) {
+	if (gtk_tree_model_iter_has_child (ts_model, iter)) {
 		GtkTreeIter child;
-		gtk_tree_model_iter_children (ts, &child, iter);
+		gtk_tree_model_iter_children (ts_model, &child, iter);
 		status = check_node (ts, folder, &child);
 	}
 
-	while (gtk_tree_model_iter_next (ts, iter) && !status) {
+	while (gtk_tree_model_iter_next (ts_model, iter) && !status) {
 		status = check_node (ts, folder, iter);
 	}
 
@@ -408,9 +411,12 @@
 static void
 add_to_store (GtkTreeStore *ts, ExchangeMAPIFolder *folder)
 {
+	GtkTreeModel *ts_model;
 	GtkTreeIter iter;
+
+	ts_model = GTK_TREE_MODEL (ts);
 	
-	gtk_tree_model_get_iter_first (ts, &iter);
+	gtk_tree_model_get_iter_first (ts_model, &iter);
 	if (!check_node (ts, folder, &iter)) {
 		GtkTreeIter node;
 		gtk_tree_store_append (ts, &node, &iter);		

Modified: trunk/src/calendar/e-cal-backend-mapi.c
==============================================================================
--- trunk/src/calendar/e-cal-backend-mapi.c	(original)
+++ trunk/src/calendar/e-cal-backend-mapi.c	Tue Dec 16 17:23:40 2008
@@ -376,10 +376,12 @@
 notify_progress (ECalBackendMAPI *cbmapi, guint64 index, guint64 total)
 {
 	guint percent = ((float)index/total) * 100 ;
+	gchar *progress_string;
+
 	if (percent > 100)
 		percent = 99; 
 
-	gchar *progress_string = g_strdup_printf (_("Loading %s items"), get_element_type (e_cal_backend_get_kind (E_CAL_BACKEND (cbmapi)))); 
+	progress_string = g_strdup_printf (_("Loading %s items"), get_element_type (e_cal_backend_get_kind (E_CAL_BACKEND (cbmapi)))); 
 
 	e_cal_backend_notify_view_progress (E_CAL_BACKEND (cbmapi), progress_string, percent);
 

Modified: trunk/src/camel/camel-mapi-folder.c
==============================================================================
--- trunk/src/camel/camel-mapi-folder.c	(original)
+++ trunk/src/camel/camel-mapi-folder.c	Tue Dec 16 17:23:40 2008
@@ -42,6 +42,7 @@
 #include <exchange-mapi-defs.h>
 #include <exchange-mapi-utils.h>
 #include <exchange-mapi-folder.h>
+#include <exchange-mapi-cal-utils.h>
 
 #include "camel-mapi-store.h"
 #include "camel-mapi-folder.h"
@@ -202,7 +203,7 @@
 
 	for (j = 0; j < item_data->properties->cValues; j++) {
 
-		gpointer prop_data = get_mapi_SPropValue_data(&item_data->properties->lpProps[j]);
+		gconstpointer prop_data = get_mapi_SPropValue_data(&item_data->properties->lpProps[j]);
 
 		switch (item_data->properties->lpProps[j].ulPropTag) {
 		/* FIXME : Instead of duping. Use talloc_steal to reuse the memory */
@@ -306,6 +307,7 @@
 	for ( ; item_list != NULL ; item_list = g_slist_next (item_list) ) {
 		MapiItem *temp_item ;
 		MapiItem *item;
+		gchar *msg_uid;
 		guint64 id;
 
 		exists = FALSE;
@@ -322,7 +324,7 @@
 		/************************ First populate summary *************************/
 		mi = NULL;
 		pmi = NULL;
-		char *msg_uid = exchange_mapi_util_mapi_ids_to_uid (item->fid, item->mid);
+		msg_uid = exchange_mapi_util_mapi_ids_to_uid (item->fid, item->mid);
 		pmi = camel_folder_summary_uid (folder->summary, msg_uid);
 
 		if (pmi) {
@@ -437,9 +439,10 @@
 			const char *uid;
 			mapi_id_t *mid = g_new0 (mapi_id_t, 1); /* FIXME : */
 			mapi_id_t temp_fid;
+			guint32 flags;
 
 			uid = camel_message_info_uid (info);
-			guint32 flags= camel_message_info_flags (info);
+			flags= camel_message_info_flags (info);
 
 			/* Why are we getting so much noise here :-/ */
 			if (!exchange_mapi_util_mapi_ids_from_uid (uid, &temp_fid, mid))
@@ -595,6 +598,7 @@
 
 		fetch_data->last_modification_time = g_new0 (struct timeval, 1); /*First Sync*/
 
+		/* XXX Casting a timeval to a GTimeVal is not portable. */
 		if (mapi_summary->sync_time_stamp && *mapi_summary->sync_time_stamp &&
 		    g_time_val_from_iso8601 (mapi_summary->sync_time_stamp, fetch_data->last_modification_time)) {
 			struct SPropValue sprop;
@@ -649,6 +653,7 @@
 		}
 
 		/*Preserve last_modification_time from this fetch for later use with restrictions.*/
+		/* XXX Casting a timeval to a GTimeVal is not portable. */
 		mapi_summary->sync_time_stamp = g_time_val_to_iso8601 (fetch_data->last_modification_time);
 
 		camel_folder_summary_touch (folder->summary);
@@ -839,7 +844,7 @@
 
 	for (j = 0; j < item_data->properties->cValues; j++) {
 
-		gpointer prop_data = get_mapi_SPropValue_data(&item_data->properties->lpProps[j]);
+		gconstpointer prop_data = get_mapi_SPropValue_data(&item_data->properties->lpProps[j]);
 
 		switch (item_data->properties->lpProps[j].ulPropTag) {
 		/*FIXME : Instead of duping. Use talloc_steal to reuse the memory*/
@@ -976,6 +981,8 @@
 	char *temp_str = NULL;
 	time_t recieved_time;
 	CamelInternetAddress *addr = NULL;
+	int offset = 0;
+	time_t actual_time;
 
 	temp_str = item->header.subject;
 	if(temp_str) 
@@ -983,8 +990,7 @@
 
 	recieved_time = item->header.recieved_time;
 
-	int offset = 0;
-	time_t actual_time = camel_header_decode_date (ctime(&recieved_time), &offset);
+	actual_time = camel_header_decode_date (ctime(&recieved_time), &offset);
 	camel_mime_message_set_date (msg, actual_time, offset);
 
 	if (item->header.from) {
@@ -1005,10 +1011,10 @@
 mapi_populate_msg_body_from_item (CamelMultipart *multipart, MapiItem *item, ExchangeMAPIStream *body)
 {
 	CamelMimePart *part;
+	const char* type = NULL;
 
 	part = camel_mime_part_new ();
 	camel_mime_part_set_encoding(part, CAMEL_TRANSFER_ENCODING_8BIT);
-	const char* type = NULL;
 	
 	if (body) { 
 		if (item->is_cal)
@@ -1139,6 +1145,11 @@
 	CamelStream *stream, *cache_stream;
 	int errno;
 
+	mapi_id_t id_folder;
+	mapi_id_t id_message;
+	MapiItem *item = NULL;
+	guint32 options = 0;
+
 	/* see if it is there in cache */
 
 	mi = (CamelMapiMessageInfo *) camel_folder_summary_uid (folder->summary, uid);
@@ -1193,11 +1204,6 @@
 		return NULL;
 	}
 
-	mapi_id_t id_folder;
-	mapi_id_t id_message;
-	MapiItem *item = NULL;
-	guint32 options = 0;
-
 	options = MAPI_OPTIONS_FETCH_ALL | MAPI_OPTIONS_FETCH_BODY_STREAM | MAPI_OPTIONS_GETBESTBODY ;
 	exchange_mapi_util_mapi_ids_from_uid (uid, &id_folder, &id_message);
 
@@ -1374,7 +1380,7 @@
 				deleted_head = NULL;
 				deleted_head = deleted_items = g_slist_prepend (deleted_items, mid);
 			}
-			deleted_items_uid = g_slist_prepend (deleted_items_uid, uid);
+			deleted_items_uid = g_slist_prepend (deleted_items_uid, (gpointer) uid);
 		}
 		camel_message_info_free (info);
 	}
@@ -1424,7 +1430,7 @@
 	CamelMapiStore *mapi_store= CAMEL_MAPI_STORE(source->parent_store);
 	CamelFolderChangeInfo *changes = NULL;
 
-	char *folder_id = NULL;
+	const gchar *folder_id = NULL;
 	int i = 0;
 
 	GSList *src_msg_ids = NULL;

Modified: trunk/src/camel/camel-mapi-store.c
==============================================================================
--- trunk/src/camel/camel-mapi-store.c	(original)
+++ trunk/src/camel/camel-mapi-store.c	Tue Dec 16 17:23:40 2008
@@ -402,7 +402,7 @@
 	if (!(fid && *fid)) 
 		return FALSE;
 
-	return (g_hash_table_find (priv->default_folders, hash_check_fid_presence, fid) != NULL);
+	return (g_hash_table_find (priv->default_folders, hash_check_fid_presence, (gpointer) fid) != NULL);
 }
 
 static const gchar*
@@ -920,9 +920,9 @@
 		if ( !strcmp(name, camel_mapi_store_info_full_name (mapi_store->summary, si))
 		     || match_path (path, camel_mapi_store_info_full_name (mapi_store->summary, si))) {
 
-			gchar *store_info_path = camel_store_info_path((CamelStoreSummary *)mapi_store->summary, si);
+			const gchar *store_info_path = camel_store_info_path((CamelStoreSummary *)mapi_store->summary, si);
 			gchar *parent_name = NULL;
-			gchar *folder_name = NULL;
+			const gchar *folder_name = NULL;
 
 			/* TODO : UTF8 / i18n*/
 			if (g_str_has_prefix (store_info_path, DISPLAY_NAME_ALL_PUBLIC_FOLDERS) && subscribed) {
@@ -1156,7 +1156,7 @@
 			continue;
 
 		info = mapi_convert_to_folder_info (store, folder, (const char *)url, ex);
-		if (!(mapi_si = camel_store_summary_path ((CamelStoreSummary *)store->summary, info->full_name))){
+		if (!(mapi_si = (CamelMapiStoreInfo *) camel_store_summary_path ((CamelStoreSummary *)store->summary, info->full_name))){
 			mapi_si = camel_mapi_store_summary_add_from_full (store->summary, info->full_name, '/');
 			if (mapi_si == NULL) {
 				continue;

Modified: trunk/src/camel/camel-mapi-transport.c
==============================================================================
--- trunk/src/camel/camel-mapi-transport.c	(original)
+++ trunk/src/camel/camel-mapi-transport.c	Tue Dec 16 17:23:40 2008
@@ -430,13 +430,14 @@
 static void
 mapi_item_add_recipient (const char *recipients, OlMailRecipientType type, GSList **recipient_list)
 {
+	ExchangeMAPIRecipient *recipient;
 	uint32_t val = 0;
 	const char *str = NULL;
 
 	if (!recipients)
 		return ;
 
-	ExchangeMAPIRecipient *recipient = g_new0 (ExchangeMAPIRecipient, 1);
+	recipient = g_new0 (ExchangeMAPIRecipient, 1);
 
 	recipient->email_id = recipients;
 

Modified: trunk/src/libexchangemapi/exchange-mapi-cal-utils.c
==============================================================================
--- trunk/src/libexchangemapi/exchange-mapi-cal-utils.c	(original)
+++ trunk/src/libexchangemapi/exchange-mapi-cal-utils.c	Tue Dec 16 17:23:40 2008
@@ -1663,8 +1663,8 @@
 		e_cal_component_alarm_get_action (alarm, &action);
 		if (action == E_CAL_COMPONENT_ALARM_DISPLAY) {
 			ECalComponentAlarmTrigger trigger;
-			e_cal_component_alarm_get_trigger (alarm, &trigger);
 			int dur_int = 0; 
+			e_cal_component_alarm_get_trigger (alarm, &trigger);
 			switch (trigger.type) {
 			case E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START :
 				dur_int = (icaldurationtype_as_int (trigger.u.rel_duration)) / SECS_IN_MINUTE;

Modified: trunk/src/libexchangemapi/exchange-mapi-connection.c
==============================================================================
--- trunk/src/libexchangemapi/exchange-mapi-connection.c	(original)
+++ trunk/src/libexchangemapi/exchange-mapi-connection.c	Tue Dec 16 17:23:40 2008
@@ -1172,6 +1172,7 @@
 			retval = GetPropsAll (&obj_message, &properties_array);
 
 		if (retval == MAPI_E_SUCCESS) {
+			FetchItemsCallbackData *item_data;
 			uint32_t z;
 
 			/* just to get all the other streams */
@@ -1183,7 +1184,7 @@
 			mapi_SPropValue_array_named(&obj_message, &properties_array);
 
 			/* NOTE: stream_list, recipient_list and attach_list should be freed by the callback */
-			FetchItemsCallbackData *item_data = g_new0 (FetchItemsCallbackData, 1);
+			item_data = g_new0 (FetchItemsCallbackData, 1);
 			item_data->fid = *pfid;
 			item_data->mid = *pmid;
 			item_data->properties = &properties_array;



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