[evolution-data-server] Fix compiler warnings in addressbook.



commit b228b1a789f724ce888524320ae68b8f38bb480c
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sun May 31 22:58:15 2009 -0400

    Fix compiler warnings in addressbook.
---
 .../backends/groupwise/e-book-backend-groupwise.c  |   78 ++-----------------
 addressbook/backends/ldap/e-book-backend-ldap.c    |   51 +++++++------
 addressbook/libebook/e-address-western.c           |    2 +-
 addressbook/libebook/e-book-query.c                |   17 ++--
 addressbook/libebook/e-book.c                      |   10 +-
 addressbook/libebook/e-book.h                      |    4 +-
 addressbook/libebook/e-contact.c                   |    8 +-
 addressbook/libebook/e-destination.c               |    4 +-
 addressbook/libebook/e-vcard.c                     |   10 +-
 addressbook/libedata-book/e-book-backend-sexp.c    |    2 +-
 addressbook/libedata-book/e-book-backend-summary.c |    4 +-
 addressbook/libedata-book/e-data-book.c            |    2 +-
 addressbook/libedata-book/e-data-book.h            |    2 +-
 addressbook/tests/ebook/test-categories.c          |    6 +-
 addressbook/tests/ebook/test-query.c               |    2 +-
 addressbook/tests/ebook/test-untyped-phones.c      |    2 +-
 libedataserver/e-sexp.c                            |   10 +-
 libedataserver/e-sexp.h                            |   10 +-
 servers/groupwise/e-gw-item.c                      |   12 ++--
 servers/groupwise/e-gw-item.h                      |   10 +-
 20 files changed, 94 insertions(+), 152 deletions(-)

diff --git a/addressbook/backends/groupwise/e-book-backend-groupwise.c b/addressbook/backends/groupwise/e-book-backend-groupwise.c
index 61ad2de..04789ef 100644
--- a/addressbook/backends/groupwise/e-book-backend-groupwise.c
+++ b/addressbook/backends/groupwise/e-book-backend-groupwise.c
@@ -126,7 +126,7 @@ static void fill_contact_from_gw_item (EContact *contact, EGwItem *item, GHashTa
 static const struct field_element_mapping {
 	EContactField field_id;
 	gint element_type;
-	gchar *element_name;
+	const gchar *element_name;
 	void (*populate_contact_func)(EContact *contact,    gpointer data);
 	void (*set_value_in_gw_item) (EGwItem *item, gpointer data);
 	void (*set_changes) (EGwItem *new_item, EGwItem *old_item);
@@ -260,7 +260,7 @@ populate_ims (EContact *contact, gpointer data)
 }
 
 static void
-append_ims_to_list (GList **im_list, EContact *contact,  gchar *service_name, EContactField field_id)
+append_ims_to_list (GList **im_list, EContact *contact, const gchar *service_name, EContactField field_id)
 {
 	GList *list;
 	IMAddress *address;
@@ -437,7 +437,7 @@ copy_postal_address (PostalAddress *address)
 }
 
 static void
-set_postal_address_change (EGwItem *new_item, EGwItem *old_item,  gchar *address_type)
+set_postal_address_change (EGwItem *new_item, EGwItem *old_item, const gchar *address_type)
 {
 	PostalAddress *old_postal_address;
 	PostalAddress *new_postal_address;
@@ -1025,66 +1025,6 @@ set_member_changes (EGwItem *new_item, EGwItem *old_item, EBookBackendGroupwise
 }
 
 static void
-set_organization_in_gw_item (EGwItem *item, EContact *contact, EBookBackendGroupwise *egwb)
-{
-	gchar *organization_name;
-	EGwItem *org_item, *temp_item;
-	EGwFilter *filter;
-	gint status;
-	gchar *id;
-	GList *items;
-
-	organization_name = e_contact_get (contact, E_CONTACT_ORG);
-	if (organization_name == NULL || strlen (organization_name) == 0)
-		return;
-
-	filter = e_gw_filter_new ();
-	e_gw_filter_add_filter_component (filter, E_GW_FILTER_OP_EQUAL, "name", organization_name);
-	items = NULL;
-	status = e_gw_connection_get_items (egwb->priv->cnc, egwb->priv->container_id, NULL, filter, &items);
-	g_object_unref (filter);
-	id = NULL;
-
-	for (; items != NULL; items = g_list_next (items )) {
-		temp_item = E_GW_ITEM (items->data);
-		if (e_gw_item_get_item_type (temp_item) == E_GW_ITEM_TYPE_ORGANISATION) {
-			id = g_strdup (e_gw_item_get_id (temp_item));
-			for (;items != NULL; items = g_list_next (items))
-				g_object_unref (items->data);
-			break;
-		}
-		g_object_unref (temp_item);
-	}
-	g_list_free (items);
-
-	if (id == NULL) {
-		org_item = e_gw_item_new_empty ();
-		e_gw_item_set_container_id (org_item, egwb->priv->container_id);
-		e_gw_item_set_field_value (org_item, "name", organization_name);
-		e_gw_item_set_item_type (org_item, E_GW_ITEM_TYPE_ORGANISATION);
-		status = e_gw_connection_create_item (egwb->priv->cnc, org_item, &id);
-		if ((status == E_GW_CONNECTION_STATUS_OK) && id) {
-			EContact *contact = e_contact_new ();
-			fill_contact_from_gw_item (contact, org_item, egwb->priv->categories_by_id);
-			e_contact_set (contact, E_CONTACT_UID, id);
-			e_contact_set (contact, E_CONTACT_FULL_NAME, organization_name);
-			/* book uri is always set outside fill_contact_from_gw_item() */
-			e_contact_set (contact, E_CONTACT_BOOK_URI, egwb->priv->original_uri);
-			e_book_backend_db_cache_add_contact (egwb->priv->file_db, contact);
-			e_book_backend_summary_add_contact (egwb->priv->summary, contact);
-			g_object_unref (contact);
-		}
-		g_object_unref (org_item);
-		if (status != E_GW_CONNECTION_STATUS_OK)
-			return;
-	}
-	if (id == NULL)
-		return;
-	e_gw_item_set_field_value (item, "organization_id", id);
-	e_gw_item_set_field_value (item , "organization", organization_name);
-}
-
-static void
 set_organization_changes_in_gw_item (EGwItem *new_item, EGwItem *old_item)
 {
 	gchar *old_value;
@@ -1638,7 +1578,7 @@ func_contains (struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer
 	    && argv[1]->type == ESEXP_RES_STRING) {
 		gchar *propname = argv[0]->value.string;
 		gchar *str = argv[1]->value.string;
-		gchar *gw_field_name;
+		const gchar *gw_field_name;
 
 		if (g_str_equal (propname, "x-evolution-any-field")) {
 			if (!sexp_data->is_personal_book && str && strlen(str) == 0) {
@@ -1699,7 +1639,7 @@ func_is(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 	    && argv[1]->type == ESEXP_RES_STRING) {
 		gchar *propname = argv[0]->value.string;
 		gchar *str = argv[1]->value.string;
-		gchar *gw_field_name;
+		const gchar *gw_field_name;
 
 		gw_field_name = NULL;
 		if (g_str_equal (propname, "full_name"))
@@ -1757,7 +1697,7 @@ func_beginswith(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointe
 	    && argv[1]->type == ESEXP_RES_STRING) {
 		gchar *propname = argv[0]->value.string;
 		gchar *str = argv[1]->value.string;
-		gchar *gw_field_name;
+		const gchar *gw_field_name;
 
 		if (!sexp_data->is_personal_book && str && strlen(str) == 0) {
 			/* ignore the NULL query */
@@ -1843,7 +1783,7 @@ func_exists(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer da
 	    && argv[0]->type == ESEXP_RES_STRING) {
 		gchar *propname = argv[0]->value.string;
 		gchar *str = argv[1]->value.string;
-		gchar *gw_field_name;
+		const gchar *gw_field_name;
 
 		gw_field_name = NULL;
 		if (g_str_equal (propname, "full_name"))
@@ -1883,7 +1823,7 @@ func_exists(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer da
 
 /* 'builtin' functions */
 static const struct {
-	gchar *name;
+	const gchar *name;
 	ESExpFunc *func;
 	gint type;		/* set to 1 if a function can perform shortcut evaluation, or
 				   doesn't execute everything, 0 otherwise */
@@ -2193,7 +2133,7 @@ book_view_thread (gpointer data)
 	GPtrArray *ids = NULL;
 	EDataBookView *book_view = data;
 	GroupwiseBackendSearchClosure *closure = get_closure (book_view);
-	gchar *view = NULL;
+	const gchar *view = NULL;
 	gboolean is_auto_completion = FALSE;
 	gchar *search_string = NULL;
 	GTimeVal start, end;
diff --git a/addressbook/backends/ldap/e-book-backend-ldap.c b/addressbook/backends/ldap/e-book-backend-ldap.c
index 80db1cd..ad42edc 100644
--- a/addressbook/backends/ldap/e-book-backend-ldap.c
+++ b/addressbook/backends/ldap/e-book-backend-ldap.c
@@ -153,7 +153,7 @@ typedef enum {
 
 static gboolean enable_debug = FALSE;
 
-static gchar *query_prop_to_ldap(gchar *query_prop);
+static const gchar *query_prop_to_ldap(gchar *query_prop);
 static gchar *e_book_backend_ldap_build_query (EBookBackendLDAP *bl, const gchar *query);
 
 typedef struct LDAPOp LDAPOp;
@@ -297,7 +297,7 @@ static void cert_populate (EContact *contact, struct berval **ber_values);
 
 static struct prop_info {
 	EContactField field_id;
-	gchar *ldap_attr;
+	const gchar *ldap_attr;
 #define PROP_TYPE_STRING    0x01
 #define PROP_TYPE_COMPLEX   0x02
 #define PROP_TYPE_BINARY    0x04
@@ -566,7 +566,7 @@ add_oc_attributes_to_supported_fields (EBookBackendLDAP *bl, LDAPObjectClass *oc
 	GHashTable *attr_hash = g_hash_table_new (g_str_hash, g_str_equal);
 
 	for (i = 0; i < num_prop_infos; i ++)
-		g_hash_table_insert (attr_hash, prop_info[i].ldap_attr, (gchar *)e_contact_field_name (prop_info[i].field_id));
+		g_hash_table_insert (attr_hash, (gpointer) prop_info[i].ldap_attr, (gchar*)e_contact_field_name (prop_info[i].field_id));
 
 	if (oc->oc_at_oids_must)
 		add_to_supported_fields (bl, oc->oc_at_oids_must, attr_hash);
@@ -580,7 +580,7 @@ add_oc_attributes_to_supported_fields (EBookBackendLDAP *bl, LDAPObjectClass *oc
 static void
 check_schema_support (EBookBackendLDAP *bl)
 {
-	gchar *attrs[2];
+	const gchar *attrs[2];
 	LDAPMessage *resp;
 	struct timeval timeout;
 
@@ -604,7 +604,7 @@ check_schema_support (EBookBackendLDAP *bl)
 
 	g_static_rec_mutex_lock (&eds_ldap_handler_lock);
 	if (ldap_search_ext_s (bl->priv->ldap, bl->priv->schema_dn, LDAP_SCOPE_BASE,
-			       "(objectClass=subschema)", attrs, 0,
+			       "(objectClass=subschema)", (gchar **) attrs, 0,
 			       NULL, NULL, &timeout, LDAP_NO_LIMIT, &resp) == LDAP_SUCCESS) {
 		gchar **values;
 
@@ -718,7 +718,8 @@ query_ldap_root_dse (EBookBackendLDAP *bl)
 #define MAX_DSE_ATTRS 20
 	LDAPMessage *resp;
 	gint ldap_error = LDAP_OTHER;
-	gchar *attrs[MAX_DSE_ATTRS], **values;
+	const gchar *attrs[MAX_DSE_ATTRS];
+	gchar **values;
 	gint i = 0;
 	struct timeval timeout;
 
@@ -745,7 +746,7 @@ query_ldap_root_dse (EBookBackendLDAP *bl)
 	ldap_error = ldap_search_ext_s (bl->priv->ldap,
 					LDAP_ROOT_DSE, LDAP_SCOPE_BASE,
 					"(objectclass=*)",
-					attrs, 0, NULL, NULL, &timeout, LDAP_NO_LIMIT, &resp);
+					(gchar **) attrs, 0, NULL, NULL, &timeout, LDAP_NO_LIMIT, &resp);
 	g_static_rec_mutex_unlock (&eds_ldap_handler_lock);
 	if (ldap_error != LDAP_SUCCESS) {
 		g_warning ("could not perform query on Root DSE (ldap_error 0x%02x/%s)", ldap_error, ldap_err2string (ldap_error) ? ldap_err2string (ldap_error) : "Unknown error");
@@ -3610,7 +3611,7 @@ func_contains(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer
 			g_free (match_str);
 		}
 		else {
-			gchar *ldap_attr = query_prop_to_ldap(propname);
+			const gchar *ldap_attr = query_prop_to_ldap(propname);
 
 			if (ldap_attr)
 				ldap_data->list = g_list_prepend(ldap_data->list,
@@ -3640,7 +3641,7 @@ func_is(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer data)
 	    && argv[1]->type == ESEXP_RES_STRING) {
 		gchar *propname = argv[0]->value.string;
 		gchar *str = rfc2254_escape(argv[1]->value.string);
-		gchar *ldap_attr = query_prop_to_ldap(propname);
+		const gchar *ldap_attr = query_prop_to_ldap(propname);
 
 		if (ldap_attr)
 			ldap_data->list = g_list_prepend(ldap_data->list,
@@ -3673,7 +3674,7 @@ func_beginswith(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointe
 	    && argv[1]->type == ESEXP_RES_STRING) {
 		gchar *propname = argv[0]->value.string;
 		gchar *str = rfc2254_escape(argv[1]->value.string);
-		gchar *ldap_attr = query_prop_to_ldap(propname);
+		const gchar *ldap_attr = query_prop_to_ldap(propname);
 
 		if (strlen (str) == 0) {
 			g_free (str);
@@ -3730,7 +3731,7 @@ func_endswith(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer
 	    && argv[1]->type == ESEXP_RES_STRING) {
 		gchar *propname = argv[0]->value.string;
 		gchar *str = rfc2254_escape(argv[1]->value.string);
-		gchar *ldap_attr = query_prop_to_ldap(propname);
+		const gchar *ldap_attr = query_prop_to_ldap(propname);
 
 		if (ldap_attr)
 			ldap_data->list = g_list_prepend(ldap_data->list,
@@ -3784,7 +3785,7 @@ func_exists(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer da
 			g_free (match_str);
 		}
 		else {
-			gchar *ldap_attr = query_prop_to_ldap(propname);
+			const gchar *ldap_attr = query_prop_to_ldap(propname);
 
 			if (ldap_attr)
 				ldap_data->list = g_list_prepend(ldap_data->list,
@@ -3800,7 +3801,7 @@ func_exists(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer da
 
 /* 'builtin' functions */
 static struct {
-	gchar *name;
+	const gchar *name;
 	ESExpFunc *func;
 	gint type;		/* set to 1 if a function can perform shortcut evaluation, or
 				   doesn't execute everything, 0 otherwise */
@@ -3881,8 +3882,8 @@ e_book_backend_ldap_build_query (EBookBackendLDAP *bl, const gchar *query)
 	return retval;
 }
 
-static gchar *
-query_prop_to_ldap(gchar *query_prop)
+static const gchar *
+query_prop_to_ldap (gchar *query_prop)
 {
 	gint i;
 
@@ -3991,7 +3992,7 @@ build_contact_from_entry (EBookBackendLDAP *bl,
 										    values);
 						}
 						else if (info->prop_type & PROP_TYPE_GROUP) {
-							gchar *grpattrs[3];
+							const gchar *grpattrs[3];
 							gint j, view_limit = -1, ldap_error, count;
 							EDataBookView *book_view;
 							LDAPMessage *result;
@@ -4019,15 +4020,15 @@ build_contact_from_entry (EBookBackendLDAP *bl,
 								do {
 									g_static_rec_mutex_lock (&eds_ldap_handler_lock);
 									if ((ldap_error = ldap_search_ext_s (bl->priv->ldap,
-													values[j],
-													LDAP_SCOPE_BASE,
-													NULL,
-													grpattrs, 0,
-													NULL,
-													NULL,
-													NULL,
-													view_limit,
-													&result)) == LDAP_SUCCESS) {
+						    						        values[j],
+						    						        LDAP_SCOPE_BASE,
+						    						        NULL,
+						    						        (gchar **) grpattrs, 0,
+												        NULL,
+												        NULL,
+												        NULL,
+												        view_limit,
+											    	        &result)) == LDAP_SUCCESS) {
 										/* find the e-mail ids of members */
 										cn_values = ldap_get_values (bl->priv->ldap, result, "cn");
 										email_values = ldap_get_values (bl->priv->ldap, result, "mail");
diff --git a/addressbook/libebook/e-address-western.c b/addressbook/libebook/e-address-western.c
index 44c7f63..2f7763f 100644
--- a/addressbook/libebook/e-address-western.c
+++ b/addressbook/libebook/e-address-western.c
@@ -19,7 +19,7 @@
 /* These are the keywords that will distinguish the start of an extended
    address. */
 
-static gchar *extended_keywords[] = {
+static const gchar *extended_keywords[] = {
 	"apt", "apartment", "suite", NULL
 };
 
diff --git a/addressbook/libebook/e-book-query.c b/addressbook/libebook/e-book-query.c
index 3413543..bdf58b1 100644
--- a/addressbook/libebook/e-book-query.c
+++ b/addressbook/libebook/e-book-query.c
@@ -575,7 +575,7 @@ func_exists(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer da
 
 /* 'builtin' functions */
 static const struct {
-	gchar *name;
+	const gchar *name;
 	ESExpFunc *func;
 	gint type;		/* set to 1 if a function can perform shortcut evaluation, or
 				   doesn't execute everything, 0 otherwise */
@@ -660,8 +660,9 @@ e_book_query_to_string    (EBookQuery *q)
 {
 	GString *str = g_string_new ("(");
 	GString *encoded = g_string_new ("");
-	gint i;
-	gchar *s = NULL;
+	int i;
+	char *s = NULL;
+	const gchar *cs;
 
 	switch (q->type) {
 	case E_BOOK_QUERY_TYPE_AND:
@@ -696,10 +697,10 @@ e_book_query_to_string    (EBookQuery *q)
 		break;
 	case E_BOOK_QUERY_TYPE_FIELD_TEST:
 		switch (q->query.field_test.test) {
-		case E_BOOK_QUERY_IS: s = "is"; break;
-		case E_BOOK_QUERY_CONTAINS: s = "contains"; break;
-		case E_BOOK_QUERY_BEGINS_WITH: s = "beginswith"; break;
-		case E_BOOK_QUERY_ENDS_WITH: s = "endswith"; break;
+		case E_BOOK_QUERY_IS: cs = "is"; break;
+		case E_BOOK_QUERY_CONTAINS: cs = "contains"; break;
+		case E_BOOK_QUERY_BEGINS_WITH: cs = "beginswith"; break;
+		case E_BOOK_QUERY_ENDS_WITH: cs = "endswith"; break;
 		default:
 			g_assert_not_reached();
 			break;
@@ -708,7 +709,7 @@ e_book_query_to_string    (EBookQuery *q)
 		e_sexp_encode_string (encoded, q->query.field_test.value);
 
 		g_string_append_printf (str, "%s \"%s\" %s",
-					s,
+					cs,
 					q->query.field_test.field_name,
 					encoded->str);
 		break;
diff --git a/addressbook/libebook/e-book.c b/addressbook/libebook/e-book.c
index 50f3158..c4d6f09 100644
--- a/addressbook/libebook/e-book.c
+++ b/addressbook/libebook/e-book.c
@@ -2244,7 +2244,7 @@ e_book_response_get_contacts (EBook       *book,
 static gboolean
 do_get_changes (gboolean sync,
 		EBook *book,
-		gchar *changeid,
+		const gchar *changeid,
 		GList **changes,
 		GError **error,
 		EBookListCallback cb,
@@ -2345,7 +2345,7 @@ do_get_changes (gboolean sync,
  */
 gboolean
 e_book_get_changes (EBook       *book,
-		    gchar        *changeid,
+		    const gchar *changeid,
 		    GList      **changes,
 		    GError     **error)
 {
@@ -2372,7 +2372,7 @@ e_book_get_changes (EBook       *book,
  */
 guint
 e_book_async_get_changes (EBook             *book,
-			  gchar              *changeid,
+			  const gchar       *changeid,
 			  EBookListCallback  cb,
 			  gpointer           closure)
 {
@@ -3248,8 +3248,8 @@ activate_factories_for_uri (EBook *book, const gchar *uri)
 {
 	CORBA_Environment ev;
 	Bonobo_ServerInfoList *info_list = NULL;
-	gint i;
-	gchar *query;
+	int i;
+	const gchar *query;
 	GList *factories = NULL;
 
 	query = "repo_ids.has ('IDL:GNOME/Evolution/DataServer/BookFactory:" API_VERSION "')";
diff --git a/addressbook/libebook/e-book.h b/addressbook/libebook/e-book.h
index a888ecb..8374b70 100644
--- a/addressbook/libebook/e-book.h
+++ b/addressbook/libebook/e-book.h
@@ -214,12 +214,12 @@ guint     e_book_async_get_contacts        (EBook             *book,
 
 /* Needed for syncing */
 gboolean e_book_get_changes                (EBook       *book,
-					    gchar        *changeid,
+					    const gchar *changeid,
 					    GList      **changes,
 					    GError     **error);
 
 guint    e_book_async_get_changes          (EBook             *book,
-					    gchar              *changeid,
+					    const gchar       *changeid,
 					    EBookListCallback  cb,
 					    gpointer           closure);
 
diff --git a/addressbook/libebook/e-contact.c b/addressbook/libebook/e-contact.c
index 95b5b73..d790449 100644
--- a/addressbook/libebook/e-contact.c
+++ b/addressbook/libebook/e-contact.c
@@ -497,7 +497,7 @@ static void
 photo_setter (EContact *contact, EVCardAttribute *attr, gpointer data)
 {
 	EContactPhoto *photo = data;
-	gchar *image_type, *p;
+	const gchar *image_type, *p;
 
 	switch (photo->type) {
 	case E_CONTACT_PHOTO_TYPE_INLINED:
@@ -536,7 +536,7 @@ fn_getter (EContact *contact, EVCardAttribute *attr)
 	if (attr) {
 		GList *p = e_vcard_attribute_get_values (attr);
 
-		return p && p->data ? p->data : "";
+		return p && p->data ? p->data : (gpointer) "";
 	}
 	else
 		return NULL;
@@ -1432,8 +1432,8 @@ e_contact_get (EContact *contact, EContactField field_id)
 
 		if (attr) {
 			GList *v = e_vcard_attribute_get_values (attr);
-			rv = v && v->data && !g_ascii_strcasecmp ((gchar *)v->data, "true");
-			return rv ? "1" : NULL;
+			rv = v && v->data && !g_ascii_strcasecmp ((char*)v->data, "true");
+			return rv ? (gpointer) "1" : NULL;
 		}
 	}
 	else if (info->t & E_CONTACT_FIELD_TYPE_LIST) {
diff --git a/addressbook/libebook/e-destination.c b/addressbook/libebook/e-destination.c
index 8307dda..5bb1842 100644
--- a/addressbook/libebook/e-destination.c
+++ b/addressbook/libebook/e-destination.c
@@ -1131,8 +1131,8 @@ e_destination_get_textrepv (EDestination **destv)
 	strv = g_new0 (gchar *, len + 1);
 	for (i = 0, j = 0; destv[i]; i++) {
 		if (!e_destination_empty (destv[i])) {
-			const gchar *addr = e_destination_get_address (destv[i]);
-			strv[j++] = addr ? (gchar *) addr : "";
+			const char *addr = e_destination_get_address (destv[i]);
+			strv[j++] = addr ? (char *) addr : (gchar *) "";
 		}
 	}
 
diff --git a/addressbook/libebook/e-vcard.c b/addressbook/libebook/e-vcard.c
index a7e5233..3ff2fe9 100644
--- a/addressbook/libebook/e-vcard.c
+++ b/addressbook/libebook/e-vcard.c
@@ -198,7 +198,7 @@ skip_to_next_line (gchar **p)
 /* skip forward until we hit a character in @s, CRLF, or \0.  leave *p
    pointing at the character that causes us to stop */
 static void
-skip_until (gchar **p, gchar *s)
+skip_until (char **p, const char *s)
 {
 	gchar *lp;
 
@@ -206,7 +206,7 @@ skip_until (gchar **p, gchar *s)
 
 	while (*lp != '\r' && *lp != '\0') {
 		gboolean s_matches = FALSE;
-		gchar *ls;
+		const char *ls;
 		for (ls = s; *ls; ls = g_utf8_next_char (ls)) {
 			if (g_utf8_get_char (ls) == g_utf8_get_char (lp)) {
 				s_matches = TRUE;
@@ -420,7 +420,7 @@ read_attribute_params (EVCardAttribute *attr, gchar **p, gboolean *quoted_printa
 			}
 			else {
 				if (str->len > 0) {
-					gchar *param_name;
+					const char *param_name;
 					if (!g_ascii_strcasecmp (str->str,
 								 "quoted-printable")) {
 						param_name = "ENCODING";
@@ -1258,7 +1258,7 @@ e_vcard_attribute_add_value_decoded (EVCardAttribute *attr, const gchar *value,
 		g_warning ("can't add_value_decoded with an attribute using RAW encoding.  you must set the ENCODING parameter first");
 		break;
 	case EVC_ENCODING_BASE64: {
-		gchar *b64_data = g_base64_encode (value, len);
+		gchar *b64_data = g_base64_encode ((guchar *) value, len);
 		GString *decoded = g_string_new_len (value, len);
 
 		/* make sure the decoded list is up to date */
@@ -1832,7 +1832,7 @@ e_vcard_attribute_get_values_decoded (EVCardAttribute *attr)
 				gsize len = 0;
 
 				decoded = g_base64_decode (l->data, &len);
-				attr->decoded_values = g_list_prepend (attr->decoded_values, g_string_new_len (decoded, len));
+				attr->decoded_values = g_list_prepend (attr->decoded_values, g_string_new_len ((gchar *) decoded, len));
 				g_free (decoded);
 			}
 			attr->decoded_values = g_list_reverse (attr->decoded_values);
diff --git a/addressbook/libedata-book/e-book-backend-sexp.c b/addressbook/libedata-book/e-book-backend-sexp.c
index 676708c..08b5b66 100644
--- a/addressbook/libedata-book/e-book-backend-sexp.c
+++ b/addressbook/libedata-book/e-book-backend-sexp.c
@@ -779,7 +779,7 @@ func_exists_vcard(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpoin
 
 /* 'builtin' functions */
 static struct {
-	gchar *name;
+	const gchar *name;
 	ESExpFunc *func;
 	gint type;		/* set to 1 if a function can perform shortcut evaluation, or
 				   doesn't execute everything, 0 otherwise */
diff --git a/addressbook/libedata-book/e-book-backend-summary.c b/addressbook/libedata-book/e-book-backend-summary.c
index f9c7d95..df1cc14 100644
--- a/addressbook/libedata-book/e-book-backend-summary.c
+++ b/addressbook/libedata-book/e-book-backend-summary.c
@@ -955,7 +955,7 @@ func_check(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer dat
 
 /* 'builtin' functions */
 static const struct {
-	gchar *name;
+	const gchar *name;
 	ESExpFunc *func;
 	gint type;		/* set to 1 if a function can perform shortcut evaluation, or
 				   doesn't execute everything, 0 otherwise */
@@ -1182,7 +1182,7 @@ func_beginswith(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointe
 
 /* 'builtin' functions */
 static const struct {
-	gchar *name;
+	const gchar *name;
 	ESExpFunc *func;
 	gint type;		/* set to 1 if a function can perform shortcut evaluation, or
 				   doesn't execute everything, 0 otherwise */
diff --git a/addressbook/libedata-book/e-data-book.c b/addressbook/libedata-book/e-data-book.c
index 48e0780..9c7c8bb 100644
--- a/addressbook/libedata-book/e-data-book.c
+++ b/addressbook/libedata-book/e-data-book.c
@@ -681,7 +681,7 @@ void
 e_data_book_respond_get_contact (EDataBook                              *book,
 				 guint32                                 opid,
 				 GNOME_Evolution_Addressbook_CallStatus  status,
-				 gchar                                   *vcard)
+				 const gchar                            *vcard)
 {
 	CORBA_Environment ev;
 
diff --git a/addressbook/libedata-book/e-data-book.h b/addressbook/libedata-book/e-data-book.h
index fa2cfbd..214a24d 100644
--- a/addressbook/libedata-book/e-data-book.h
+++ b/addressbook/libedata-book/e-data-book.h
@@ -96,7 +96,7 @@ void                    e_data_book_respond_get_book_view  (EDataBook
 void                    e_data_book_respond_get_contact    (EDataBook                              *book,
 							    guint32                                 opid,
 							    GNOME_Evolution_Addressbook_CallStatus  status,
-							    gchar                              *vcard);
+							    const gchar                            *vcard);
 void                    e_data_book_respond_get_contact_list (EDataBook                              *book,
 							      guint32                                 opid,
 							      GNOME_Evolution_Addressbook_CallStatus  status,
diff --git a/addressbook/tests/ebook/test-categories.c b/addressbook/tests/ebook/test-categories.c
index 62c514e..bf24a74 100644
--- a/addressbook/tests/ebook/test-categories.c
+++ b/addressbook/tests/ebook/test-categories.c
@@ -15,9 +15,9 @@ main (gint argc, gchar **argv)
 	contact = e_contact_new ();
 
 	category_list = NULL;
-	category_list = g_list_append (category_list, "Birthday");
-	category_list = g_list_append (category_list, "Business");
-	category_list = g_list_append (category_list, "Competition");
+	category_list = g_list_append (category_list, (gpointer) "Birthday");
+	category_list = g_list_append (category_list, (gpointer) "Business");
+	category_list = g_list_append (category_list, (gpointer) "Competition");
 
 	e_contact_set (contact, E_CONTACT_CATEGORY_LIST, category_list);
 
diff --git a/addressbook/tests/ebook/test-query.c b/addressbook/tests/ebook/test-query.c
index 05169d1..a81738a 100644
--- a/addressbook/tests/ebook/test-query.c
+++ b/addressbook/tests/ebook/test-query.c
@@ -4,7 +4,7 @@
 #define QUERY_STRING1
 #define QUERY_STRING2
 
-static gchar * queries[] = {
+static const gchar* queries[] = {
 	"(exists \"full_name\")",
 	"(contains \"full_name\" \"Miguel\")"
 
diff --git a/addressbook/tests/ebook/test-untyped-phones.c b/addressbook/tests/ebook/test-untyped-phones.c
index 565e65b..b999e6e 100644
--- a/addressbook/tests/ebook/test-untyped-phones.c
+++ b/addressbook/tests/ebook/test-untyped-phones.c
@@ -16,7 +16,7 @@ TEL;FAX:321-321-4321\r\n\
 END:vCard"
 
 static void
-check(gboolean test, gchar *msg)
+check(gboolean test, const gchar *msg)
 {
 	printf ("%s - %s\n", test ? "passed" : "failed", msg);
 }
diff --git a/libedataserver/e-sexp.c b/libedataserver/e-sexp.c
index 20b66b1..7f3eb1c 100644
--- a/libedataserver/e-sexp.c
+++ b/libedataserver/e-sexp.c
@@ -1130,9 +1130,9 @@ e_sexp_init (ESExp *s)
 	/* load in builtin symbols? */
 	for(i=0;i<sizeof(symbols)/sizeof(symbols[0]);i++) {
 		if (symbols[i].type == 1) {
-			e_sexp_add_ifunction(s, 0, (gchar *) symbols[i].name, (ESExpIFunc *)symbols[i].func, (gpointer)&symbols[i]);
+			e_sexp_add_ifunction(s, 0, symbols[i].name, (ESExpIFunc *)symbols[i].func, (void *)&symbols[i]);
 		} else {
-			e_sexp_add_function(s, 0, (gchar *) symbols[i].name, symbols[i].func, (gpointer)&symbols[i]);
+			e_sexp_add_function(s, 0, symbols[i].name, symbols[i].func, (void *)&symbols[i]);
 		}
 	}
 
@@ -1199,7 +1199,7 @@ e_sexp_unref (ESExp *f)
 #endif
 
 void
-e_sexp_add_function(ESExp *f, gint scope, gchar *name, ESExpFunc *func, gpointer data)
+e_sexp_add_function(ESExp *f, int scope, const char *name, ESExpFunc *func, void *data)
 {
 	struct _ESExpSymbol *s;
 
@@ -1217,7 +1217,7 @@ e_sexp_add_function(ESExp *f, gint scope, gchar *name, ESExpFunc *func, gpointer
 }
 
 void
-e_sexp_add_ifunction(ESExp *f, gint scope, gchar *name, ESExpIFunc *ifunc, gpointer data)
+e_sexp_add_ifunction(ESExp *f, int scope, const char *name, ESExpIFunc *ifunc, void *data)
 {
 	struct _ESExpSymbol *s;
 
@@ -1250,7 +1250,7 @@ e_sexp_add_variable(ESExp *f, gint scope, gchar *name, ESExpTerm *value)
 }
 
 void
-e_sexp_remove_symbol(ESExp *f, gint scope, gchar *name)
+e_sexp_remove_symbol(ESExp *f, int scope, const char *name)
 {
 	gint oldscope;
 	struct _ESExpSymbol *s;
diff --git a/libedataserver/e-sexp.h b/libedataserver/e-sexp.h
index b6e9535..ed32b13 100644
--- a/libedataserver/e-sexp.h
+++ b/libedataserver/e-sexp.h
@@ -144,11 +144,11 @@ ESExp	       *e_sexp_new		(void);
 void		e_sexp_ref		(ESExp *f);
 void		e_sexp_unref		(ESExp *f);
 #endif
-void		e_sexp_add_function	(ESExp *f, gint scope, gchar *name, ESExpFunc *func, gpointer data);
-void		e_sexp_add_ifunction	(ESExp *f, gint scope, gchar *name, ESExpIFunc *func, gpointer data);
-void		e_sexp_add_variable	(ESExp *f, gint scope, gchar *name, ESExpTerm *value);
-void		e_sexp_remove_symbol	(ESExp *f, gint scope, gchar *name);
-int		e_sexp_set_scope	(ESExp *f, gint scope);
+void		e_sexp_add_function  	(ESExp *f, int scope, const char *name, ESExpFunc *func, void *data);
+void		e_sexp_add_ifunction  	(ESExp *f, int scope, const char *name, ESExpIFunc *func, void *data);
+void		e_sexp_add_variable  	(ESExp *f, int scope, char *name, ESExpTerm *value);
+void		e_sexp_remove_symbol	(ESExp *f, int scope, const char *name);
+int		e_sexp_set_scope	(ESExp *f, int scope);
 
 void		e_sexp_input_text	(ESExp *f, const gchar *text, gint len);
 void		e_sexp_input_file	(ESExp *f, gint fd);
diff --git a/servers/groupwise/e-gw-item.c b/servers/groupwise/e-gw-item.c
index 27df1ce..68ef0a2 100644
--- a/servers/groupwise/e-gw-item.c
+++ b/servers/groupwise/e-gw-item.c
@@ -825,8 +825,8 @@ set_sendoptions_from_soap_parameter (EGwItem *item, SoupSoapParameter *param)
 	}
 }
 
-gchar *
-e_gw_item_get_field_value (EGwItem *item, gchar *field_name)
+char*
+e_gw_item_get_field_value (EGwItem *item, const gchar *field_name)
 {
 	gpointer value;
 
@@ -844,7 +844,7 @@ e_gw_item_get_field_value (EGwItem *item, gchar *field_name)
 }
 
 void
-e_gw_item_set_field_value (EGwItem *item, gchar *field_name, gchar * field_value)
+e_gw_item_set_field_value (EGwItem *item, const gchar *field_name, char* field_value)
 {
 	g_return_if_fail (field_name != NULL);
 	g_return_if_fail (field_name != NULL);
@@ -912,14 +912,14 @@ e_gw_item_set_member_list (EGwItem *item, GList *list)
 }
 
 void
-e_gw_item_set_address (EGwItem *item, gchar *address_type, PostalAddress *address)
+e_gw_item_set_address (EGwItem *item, const gchar *address_type, PostalAddress *address)
 {
 	if (address_type && address)
 		g_hash_table_insert (item->priv->addresses, address_type, address);
 
 }
 
-PostalAddress *e_gw_item_get_address (EGwItem *item, gchar *address_type)
+PostalAddress *e_gw_item_get_address (EGwItem *item, const gchar *address_type)
 {
 	return (PostalAddress *) g_hash_table_lookup (item->priv->addresses, address_type);
 }
@@ -949,7 +949,7 @@ e_gw_item_get_category_name (EGwItem *item)
 	return item->priv->category_name;
 }
 
-void e_gw_item_set_change (EGwItem *item, EGwItemChangeType change_type, gchar *field_name, gpointer field_value)
+void e_gw_item_set_change (EGwItem *item, EGwItemChangeType change_type, const gchar *field_name, gpointer field_value)
 {
 	GHashTable *hash_table;
 	EGwItemPrivate *priv;
diff --git a/servers/groupwise/e-gw-item.h b/servers/groupwise/e-gw-item.h
index 18ffa7a..a7f10e6 100644
--- a/servers/groupwise/e-gw-item.h
+++ b/servers/groupwise/e-gw-item.h
@@ -195,16 +195,16 @@ gboolean    e_gw_item_get_completed (EGwItem *item);
 void        e_gw_item_set_completed (EGwItem *item, gboolean new_completed);
 gboolean    e_gw_item_get_is_allday_event (EGwItem *item);
 void	    e_gw_item_set_is_allday_event (EGwItem *item, gboolean is_allday);
-gchar *       e_gw_item_get_field_value (EGwItem *item, gchar *field_name);
-void        e_gw_item_set_field_value (EGwItem *item, gchar *field_name, gchar * field_value);
+char*       e_gw_item_get_field_value (EGwItem *item, const gchar *field_name);
+void        e_gw_item_set_field_value (EGwItem *item, const gchar *field_name, char* field_value);
 GList*      e_gw_item_get_email_list (EGwItem *item);
 void        e_gw_item_set_email_list (EGwItem *item, GList *email_list);
 FullName*   e_gw_item_get_full_name (EGwItem *item);
 void        e_gw_item_set_full_name (EGwItem *item, FullName* full_name);
 GList*      e_gw_item_get_member_list (EGwItem *item);
 void        e_gw_item_set_member_list (EGwItem *item, GList *list);
-PostalAddress* e_gw_item_get_address (EGwItem *item, gchar *address_type);
-void        e_gw_item_set_address (EGwItem *item, gchar *addres_type, PostalAddress *address);
+PostalAddress* e_gw_item_get_address (EGwItem *item, const gchar *address_type);
+void        e_gw_item_set_address (EGwItem *item, const gchar *addres_type, PostalAddress *address);
 GList*      e_gw_item_get_im_list (EGwItem *item);
 void        e_gw_item_set_im_list (EGwItem *item, GList *im_list);
 void        e_gw_item_set_categories (EGwItem *item, GList *category_list);
@@ -219,7 +219,7 @@ EGwItemLinkInfo *e_gw_item_get_link_info (EGwItem *item);
 char	    *e_gw_item_get_content_type (EGwItem *item) ;
 const gchar *e_gw_item_get_msg_body_id (EGwItem *item);
 int	    e_gw_item_get_mail_size (EGwItem *item);
-void e_gw_item_set_change (EGwItem *item, EGwItemChangeType change_type, gchar *field_name, gpointer field_value);
+void e_gw_item_set_change (EGwItem *item, EGwItemChangeType change_type, const gchar *field_name, gpointer field_value);
 gboolean e_gw_item_append_changes_to_soap_message (EGwItem *item, SoupSoapMessage *msg);
 void e_gw_item_set_category_name (EGwItem *item, gchar *cateogry_name);
 gchar * e_gw_item_get_category_name (EGwItem *item);



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