[evolution-patches] Fix some sparse warnings in e-d-s



This is a patch that fixes a bunch of warnings from sparse in e-d-s.
Please comment.

Cheers
Kjartan

diff --git a/addressbook/backends/google/google-book.c b/addressbook/backends/google/google-book.c
index 566de42..405343f 100644
--- a/addressbook/backends/google/google-book.c
+++ b/addressbook/backends/google/google-book.c
@@ -1097,7 +1097,7 @@ google_book_get_contact (GoogleBook *book,
     priv = GET_PRIVATE (book);
 
     __debug__ (G_STRFUNC);
-    g_return_val_if_fail (IS_GOOGLE_BOOK (book), FALSE);
+    g_return_val_if_fail (IS_GOOGLE_BOOK (book), NULL);
 
     google_book_cache_refresh_if_needed (book, error);
 
@@ -1130,7 +1130,7 @@ google_book_get_all_contacts (GoogleBook *book,
     priv = GET_PRIVATE (book);
 
     __debug__ (G_STRFUNC);
-    g_return_val_if_fail (IS_GOOGLE_BOOK (book), FALSE);
+    g_return_val_if_fail (IS_GOOGLE_BOOK (book), NULL);
 
     google_book_cache_refresh_if_needed (book, error);
 
@@ -1171,7 +1171,7 @@ google_book_get_all_contacts_in_live_mode (GoogleBook *book)
     priv = GET_PRIVATE (book);
 
     __debug__ (G_STRFUNC);
-    g_return_val_if_fail (IS_GOOGLE_BOOK (book), FALSE);
+    g_return_val_if_fail (IS_GOOGLE_BOOK (book), NULL);
 
     priv->live_mode = TRUE;
 
diff --git a/addressbook/backends/google/util.c b/addressbook/backends/google/util.c
index 98c610a..25cb111 100644
--- a/addressbook/backends/google/util.c
+++ b/addressbook/backends/google/util.c
@@ -329,7 +329,7 @@ struct RelTypeMap {
     const gchar * types[3];
 };
 
-const struct RelTypeMap rel_type_map_phone[] = {
+static const struct RelTypeMap rel_type_map_phone[] = {
     {"fax", { "FAX", NULL, NULL}},
     {"home", { "HOME", "VOICE", NULL}},
     {"home_fax", { "HOME", "FAX", NULL}},
@@ -340,7 +340,7 @@ const struct RelTypeMap rel_type_map_phone[] = {
     {"work_fax", { "WORK", "FAX", NULL}}
 };
 
-const struct RelTypeMap rel_type_map_others[] = {
+static const struct RelTypeMap rel_type_map_others[] = {
     {"home", { "HOME", NULL, NULL}},
     {"other", { "OTHER", NULL, NULL}},
     {"work", { "WORK", NULL, NULL}},
diff --git a/addressbook/libebook/e-destination.c b/addressbook/libebook/e-destination.c
index 83b21d7..ef12067 100644
--- a/addressbook/libebook/e-destination.c
+++ b/addressbook/libebook/e-destination.c
@@ -1151,7 +1151,7 @@ e_destination_get_textrepv (EDestination **destv)
  *
  * Return value: Pointer to the root node of the XML tree.
  **/
-xmlNodePtr
+static xmlNodePtr
 e_destination_xml_encode (const EDestination *dest)
 {
 	xmlNodePtr dest_node;
@@ -1234,7 +1234,7 @@ e_destination_xml_encode (const EDestination *dest)
  *
  * Return value: %TRUE if the XML tree was well-formed, %FALSE otherwise.
  **/
-gboolean
+static gboolean
 e_destination_xml_decode (EDestination *dest, xmlNodePtr node)
 {
 	gchar *name = NULL, *email = NULL, *source_uid = NULL, *card_uid = NULL;
diff --git a/calendar/backends/caldav/e-cal-backend-caldav.c b/calendar/backends/caldav/e-cal-backend-caldav.c
index 08fb02a..69c65f5 100644
--- a/calendar/backends/caldav/e-cal-backend-caldav.c
+++ b/calendar/backends/caldav/e-cal-backend-caldav.c
@@ -2710,7 +2710,7 @@ convert_to_inline_attachment (ECalBackendCalDAV *cbdav, icalcomponent *icalcomp)
 			 * be embedded in a soap message
 			 */
 			encoded = g_base64_encode ((guchar *) content, len);
-			attach = icalattach_new_from_data ((guchar *) encoded, 0, 0);
+			attach = icalattach_new_from_data ((guchar *) encoded, NULL, NULL);
 			g_free(content);
 			g_free(encoded);
 
@@ -4157,7 +4157,7 @@ caldav_get_free_busy (ECalBackendSync  *backend,
 	e_cal_component_set_dtend (comp, &dt);
 
 	if (priv->username) {
-		ECalComponentOrganizer organizer = {0};
+		ECalComponentOrganizer organizer = {NULL};
 
 		organizer.value = priv->username;
 		e_cal_component_set_organizer (comp, &organizer);
diff --git a/calendar/backends/contacts/e-cal-backend-contacts.c b/calendar/backends/contacts/e-cal-backend-contacts.c
index 8606936..c701d10 100644
--- a/calendar/backends/contacts/e-cal-backend-contacts.c
+++ b/calendar/backends/contacts/e-cal-backend-contacts.c
@@ -916,7 +916,7 @@ init_sources_cb (ECalBackendContacts *cbc)
         ECalBackendContactsPrivate *priv;
         GSList *i;
 
-	g_return_val_if_fail (cbc != NULL, FALSE);
+	g_return_val_if_fail (cbc != NULL, NULL);
 
 	priv = cbc->priv;
 
diff --git a/calendar/backends/google/e-cal-backend-google-utils.c b/calendar/backends/google/e-cal-backend-google-utils.c
index 5ed864e..c5b3036 100644
--- a/calendar/backends/google/e-cal-backend-google-utils.c
+++ b/calendar/backends/google/e-cal-backend-google-utils.c
@@ -776,7 +776,7 @@ utils_update_deletion (ECalBackendGoogle *cbgo, ECalBackendCache *cache, GSList
  * @dt a #ECalComponentDateTime value
  **/
 /* FIXME use proper functions to manipulate the dates */
-gchar *
+static gchar *
 get_date (ECalComponentDateTime dt)
 {
 	gchar *temp;
diff --git a/calendar/libecal/e-cal.c b/calendar/libecal/e-cal.c
index a75f6ab..f4f33ce 100644
--- a/calendar/libecal/e-cal.c
+++ b/calendar/libecal/e-cal.c
@@ -1071,7 +1071,7 @@ e_cal_init (ECal *ecal, ECalClass *klass)
 	priv->cal_address = NULL;
 	priv->alarm_email_address = NULL;
 	priv->ldap_attribute = NULL;
-	priv->capabilities = FALSE;
+	priv->capabilities = NULL;
 	priv->factories = NULL;
 	priv->timezones = g_hash_table_new (g_str_hash, g_str_equal);
 	priv->default_zone = icaltimezone_get_utc_timezone ();
diff --git a/calendar/tests/ecal/test-ecal.c b/calendar/tests/ecal/test-ecal.c
index e52eccf..de537da 100644
--- a/calendar/tests/ecal/test-ecal.c
+++ b/calendar/tests/ecal/test-ecal.c
@@ -699,7 +699,7 @@ create_client (ECal **client, const gchar *uri, ECalSourceType type, gboolean on
 	results = all_tests (*client, uri);
 	cl_printf (*client, "\n\n\n*************Tests run: %d****************\n\n", tests_run);
 	cl_printf (*client, "*************Tests passed: %d*************\n\n\n", tests_passed);
-	if (results != 0)
+	if (results != NULL)
 		cl_printf (*client, "***Failures********%s\n", results);
 
 	cl_printf (*client, "dump of the test calendar data");
diff --git a/camel/camel-data-cache.c b/camel/camel-data-cache.c
index 5c38240..09be951 100644
--- a/camel/camel-data-cache.c
+++ b/camel/camel-data-cache.c
@@ -254,7 +254,7 @@ data_cache_path(CamelDataCache *cdc, gint create, const gchar *path, const gchar
 		dd(printf("Checking expire cycle time on dir '%s'\n", dir));
 
 		/* This has a race, but at worst we re-run an expire cycle which is safe */
-		now = time(0);
+		now = time(NULL);
 		if (cdc->priv->expire_last[hash] + CAMEL_DATA_CACHE_CYCLE_TIME < now) {
 			cdc->priv->expire_last[hash] = now;
 			data_cache_expire(cdc, dir, key, now);
diff --git a/camel/camel-db.c b/camel/camel-db.c
index 696b6e9..e771e8d 100644
--- a/camel/camel-db.c
+++ b/camel/camel-db.c
@@ -366,13 +366,13 @@ cdb_sql_exec (sqlite3 *db, const gchar * stmt, CamelException *ex)
 
 	d(g_print("Camel SQL Exec:\n%s\n", stmt));
 
-	ret = sqlite3_exec(db, stmt, 0, 0, &errmsg);
+	ret = sqlite3_exec(db, stmt, NULL, NULL, &errmsg);
 	while (ret == SQLITE_BUSY || ret == SQLITE_LOCKED || ret == -1) {
 		if (errmsg) {
 			sqlite3_free (errmsg);
 			errmsg = NULL;
 		}
-		ret = sqlite3_exec(db, stmt, 0, 0, &errmsg);
+		ret = sqlite3_exec(db, stmt, NULL, NULL, &errmsg);
 	}
 
 	if (ret != SQLITE_OK) {
diff --git a/camel/camel-folder-summary.h b/camel/camel-folder-summary.h
index 6281d18..9316f11 100644
--- a/camel/camel-folder-summary.h
+++ b/camel/camel-folder-summary.h
@@ -152,7 +152,7 @@ struct _CamelMessageInfo {
 	guint32 refcount;	/* ??? */
 	const gchar *uid;
 	/*FIXME: Make it work with the CAMEL_MESSADE_DB_DIRTY flag instead of another 4 bytes*/
-	gint dirty:1;
+	guint dirty:1;
 };
 
 /* For classes wishing to do the provided i/o, or for anonymous users,
@@ -164,7 +164,7 @@ struct _CamelMessageInfoBase {
 	guint32 refcount;	/* ??? */
 	const gchar *uid;
 	/*FIXME: Make it work with the CAMEL_MESSADE_DB_DIRTY flag instead of another 4 bytes*/
-	gint dirty:1;
+	guint dirty:1;
 
 	const gchar *subject;
 	const gchar *from;
diff --git a/camel/camel-mime-utils.c b/camel/camel-mime-utils.c
index a304c5c..258c8ee 100644
--- a/camel/camel-mime-utils.c
+++ b/camel/camel-mime-utils.c
@@ -1433,7 +1433,7 @@ rfc2047_encode_word(GString *outstring, const gchar *in, gsize len, const gchar
 				inptr += convlen;
 			} else {
 				/* make sure we flush out any shift state */
-				camel_iconv (ic, NULL, 0, &out, &outlen);
+				camel_iconv (ic, NULL, NULL, &out, &outlen);
 			}
 			inlen -= (inptr - p);
 		}
@@ -2063,7 +2063,7 @@ header_convert(const gchar *to, const gchar *from, const gchar *in, gsize inlen)
 
 	ret = camel_iconv(ic, &in, &inlen, &outbuf, &outlen);
 	if (ret != (gsize) -1) {
-		camel_iconv(ic, NULL, 0, &outbuf, &outlen);
+		camel_iconv(ic, NULL, NULL, &outbuf, &outlen);
 		*outbuf = '\0';
 		result = g_strdup(outbase);
 	}
@@ -2166,7 +2166,7 @@ camel_header_set_param (struct _camel_header_param **l, const gchar *name, const
 		return NULL;
 
 	pn = g_malloc (sizeof (*pn));
-	pn->next = 0;
+	pn->next = NULL;
 	pn->name = g_strdup (name);
 	pn->value = g_strdup (value);
 	p->next = pn;
@@ -2837,7 +2837,7 @@ camel_header_references_list_append_asis(struct _camel_header_references **list,
 		w = w->next;
 	n = g_malloc(sizeof(*n));
 	n->id = ref;
-	n->next = 0;
+	n->next = NULL;
 	w->next = n;
 }
 
@@ -3324,11 +3324,12 @@ header_encode_param (const guchar *in, gboolean *encoded, gboolean is_filename)
 	return str;
 }
 
-/* HACK: Set to non-zero when you want the 'filename' and 'name' headers encode in RFC 2047 way,
+/* HACK: Set to non-zero when you want the 'filename' and 'name' headers encoded in RFC 2047 way,
    otherwise they will be encoded in the correct RFC 2231 way. It's because Outlook and GMail
    do not understand the correct standard and refuse attachments with localized name sent
-   from evolution. */
-gint camel_header_param_encode_filenames_in_rfc_2047 = 0;
+   from evolution. This seems to have been fixed in Exchange 2007 at least - not sure about
+   standalone Outlook. */
+static gint camel_header_param_encode_filenames_in_rfc_2047 = 0;
 
 void
 camel_header_param_list_format_append (GString *out, struct _camel_header_param *p)
diff --git a/camel/camel-search-private.c b/camel/camel-search-private.c
index 37719fb..3b8c83d 100644
--- a/camel/camel-search-private.c
+++ b/camel/camel-search-private.c
@@ -141,7 +141,7 @@ camel_search_build_match_regex (regex_t *pattern, camel_search_flags_t type, gin
 	if (err != 0) {
 		/* regerror gets called twice to get the full error string
 		   length to do proper posix error reporting */
-		gint len = regerror (err, pattern, 0, 0);
+		gint len = regerror (err, pattern, NULL, 0);
 		gchar *buffer = g_malloc0 (len + 1);
 
 		regerror (err, pattern, buffer, len);
diff --git a/camel/camel-search-sql-sexp.c b/camel/camel-search-sql-sexp.c
index 3490085..a6d432d 100644
--- a/camel/camel-search-sql-sexp.c
+++ b/camel/camel-search-sql-sexp.c
@@ -559,7 +559,7 @@ sql_exp (struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 static struct {
 	const gchar *name;
 	ESExpFunc *func;
-	gint immediate :1;
+	guint immediate :1;
 } symbols[] = {
 	{ "and", (ESExpFunc *) func_and, 1 },
 	{ "or", (ESExpFunc *) func_or, 1},
diff --git a/camel/camel-search-sql.c b/camel/camel-search-sql.c
index 8d7b766..a191f0b 100644
--- a/camel/camel-search-sql.c
+++ b/camel/camel-search-sql.c
@@ -103,13 +103,13 @@ typedef struct Node {
 	gchar post_token; /* post token to apppend with substitute */
 	gchar rval; /* rhs value for binary ops */
 	gint level; /* depth in the hier */
-	gint prefix:1; /* unary operator to be searched ?*/
-	gint sys_node:1; /* is it a predefined term ? */
-	gint ignore_lhs:1; /* ignore lhs value ?*/
-	gint swap :1;
-	gint prenode :1;
-	gint operator:1;
-	gint execute:1;
+	guint prefix:1; /* unary operator to be searched ?*/
+	guint sys_node:1; /* is it a predefined term ? */
+	guint ignore_lhs:1; /* ignore lhs value ?*/
+	guint swap :1;
+	guint prenode :1;
+	guint operator:1;
+	guint execute:1;
 	gint ref;
 }Node;
 
diff --git a/camel/providers/groupwise/camel-groupwise-provider.c b/camel/providers/groupwise/camel-groupwise-provider.c
index 6b44948..69b898e 100644
--- a/camel/providers/groupwise/camel-groupwise-provider.c
+++ b/camel/providers/groupwise/camel-groupwise-provider.c
@@ -47,7 +47,7 @@ static guint groupwise_url_hash (gconstpointer key);
 static gint check_equal (gchar *s1, gchar *s2);
 static gint groupwise_url_equal (gconstpointer a, gconstpointer b);
 
-CamelProviderConfEntry groupwise_conf_entries[] = {
+static CamelProviderConfEntry groupwise_conf_entries[] = {
 	/* override the labels/defaults of the standard settings */
 
 	{ CAMEL_PROVIDER_CONF_SECTION_START, "mailcheck", NULL,
diff --git a/camel/providers/imap/camel-imap-provider.c b/camel/providers/imap/camel-imap-provider.c
index 42febef..d5c9ef8 100644
--- a/camel/providers/imap/camel-imap-provider.c
+++ b/camel/providers/imap/camel-imap-provider.c
@@ -39,7 +39,7 @@ static guint imap_url_hash (gconstpointer key);
 static gint check_equal (gchar *s1, gchar *s2);
 static gint imap_url_equal (gconstpointer a, gconstpointer b);
 
-CamelProviderConfEntry imap_conf_entries[] = {
+static CamelProviderConfEntry imap_conf_entries[] = {
 	{ CAMEL_PROVIDER_CONF_SECTION_START, "mailcheck", NULL,
 	  N_("Checking for New Mail") },
 	{ CAMEL_PROVIDER_CONF_CHECKBOX, "check_all", NULL,
diff --git a/libedataserverui/e-source-option-menu.c b/libedataserverui/e-source-option-menu.c
index f9afc26..0a21f6f 100644
--- a/libedataserverui/e-source-option-menu.c
+++ b/libedataserverui/e-source-option-menu.c
@@ -20,6 +20,8 @@
  * Author: Ettore Perazzoli <ettore ximian com>
  */
 
+#undef GTK_DISABLE_DEPRECATED
+
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
diff --git a/servers/google/libgdata-google/gdata-google-service.c b/servers/google/libgdata-google/gdata-google-service.c
index b0e1890..3f085ab 100644
--- a/servers/google/libgdata-google/gdata-google-service.c
+++ b/servers/google/libgdata-google/gdata-google-service.c
@@ -347,8 +347,8 @@ gdata_google_service_update_entry (GDataService *service, GDataEntry *entry, GEr
 {
 	const gchar *entry_edit_url;
 
-	g_return_val_if_fail (service !=NULL, FALSE);
-	g_return_val_if_fail (GDATA_IS_GOOGLE_SERVICE (service), FALSE);
+	g_return_val_if_fail (service !=NULL, NULL);
+	g_return_val_if_fail (GDATA_IS_GOOGLE_SERVICE (service), NULL);
 
 	entry_edit_url = gdata_entry_get_edit_link (entry);
 
@@ -374,9 +374,9 @@ gdata_google_service_update_entry_with_link (GDataService *service, GDataEntry *
 	gchar *entry_xml;
 	GDataEntry *updated_entry = NULL;
 
-	g_return_val_if_fail (service !=NULL, FALSE);
-	g_return_val_if_fail (GDATA_IS_GOOGLE_SERVICE (service), FALSE);
-	g_return_val_if_fail (edit_link !=NULL, FALSE);
+	g_return_val_if_fail (service !=NULL, NULL);
+	g_return_val_if_fail (GDATA_IS_GOOGLE_SERVICE (service), NULL);
+	g_return_val_if_fail (edit_link !=NULL, NULL);
 
 	if (!service_is_authenticated( GDATA_GOOGLE_SERVICE(service) )) {
 		if (FALSE == gdata_google_service_authenticate(GDATA_GOOGLE_SERVICE(service), error))




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