[evolution-data-server] Fix compiler warnings.



commit 00faede4156042b1f74adeba89fcecca602dae55
Author: Matthew Barnes <mbarnes redhat com>
Date:   Fri Oct 23 23:44:24 2009 -0400

    Fix compiler warnings.

 .../backends/groupwise/e-book-backend-groupwise.c  |    2 +-
 addressbook/libedata-book/e-data-book-factory.c    |    2 +-
 addressbook/libedata-book/e-data-book.c            |    2 +-
 calendar/libecal/e-cal.c                           |   20 ++++++++++----------
 calendar/libedata-cal/e-data-cal-factory.c         |    9 +++++----
 libedataserverui/e-categories-dialog.c             |    8 ++++----
 6 files changed, 22 insertions(+), 21 deletions(-)
---
diff --git a/addressbook/backends/groupwise/e-book-backend-groupwise.c b/addressbook/backends/groupwise/e-book-backend-groupwise.c
index ee6ca2e..ebd0cc7 100644
--- a/addressbook/backends/groupwise/e-book-backend-groupwise.c
+++ b/addressbook/backends/groupwise/e-book-backend-groupwise.c
@@ -1780,7 +1780,7 @@ func_exists(struct _ESExp *f, gint argc, struct _ESExpResult **argv, gpointer da
 	if (argc == 1
 	    && argv[0]->type == ESEXP_RES_STRING) {
 		gchar *propname = argv[0]->value.string;
-		gchar *str = "";
+		const gchar *str = "";
 		const gchar *gw_field_name;
 
 		gw_field_name = NULL;
diff --git a/addressbook/libedata-book/e-data-book-factory.c b/addressbook/libedata-book/e-data-book-factory.c
index 47e7b6e..cac1b68 100644
--- a/addressbook/libedata-book/e-data-book-factory.c
+++ b/addressbook/libedata-book/e-data-book-factory.c
@@ -381,7 +381,7 @@ name_owner_changed (DBusGProxy *proxy,
 }
 
 /* Convenience function to print an error and exit */
-static void
+G_GNUC_NORETURN static void
 die (const char *prefix, GError *error)
 {
 	g_error("%s: %s", prefix, error->message);
diff --git a/addressbook/libedata-book/e-data-book.c b/addressbook/libedata-book/e-data-book.c
index da21c06..d21fcd6 100644
--- a/addressbook/libedata-book/e-data-book.c
+++ b/addressbook/libedata-book/e-data-book.c
@@ -390,7 +390,7 @@ data_book_return_error (DBusGMethodInvocation *context, gint code, const char *e
 {
 	GError *error;
 	
-	error = g_error_new (E_DATA_BOOK_ERROR, code, error_str) ;
+	error = g_error_new (E_DATA_BOOK_ERROR, code, "%s", error_str) ;
 	dbus_g_method_return_error (context, error);
 	
 	g_error_free (error);
diff --git a/calendar/libecal/e-cal.c b/calendar/libecal/e-cal.c
index f849038..b5df1af 100644
--- a/calendar/libecal/e-cal.c
+++ b/calendar/libecal/e-cal.c
@@ -151,19 +151,19 @@ static GObjectClass *parent_class;
        };				}G_STMT_END
 #endif
 
-#define E_CALENDAR_CHECK_STATUS(status,error) G_STMT_START{		\
-	if ((status) == E_CALENDAR_STATUS_OK) {				\
+#define E_CALENDAR_CHECK_STATUS(status,error)				\
+G_STMT_START{								\
+	if ((status) == E_CALENDAR_STATUS_OK)				\
 		return TRUE;						\
-	}								\
-	else {                                                          \
-		if (error) { \
-			return unwrap_gerror (error); \
-		} \
-                const gchar *msg;                                        \
-                msg = e_cal_get_error_message ((status));          \
+	else {								\
+		const gchar *msg;					\
+		if (error)						\
+			return unwrap_gerror (error);			\
+		msg = e_cal_get_error_message ((status));		\
 		g_set_error ((error), E_CALENDAR_ERROR, (status), "%s", msg);	\
 		return FALSE;						\
-	}				}G_STMT_END
+	}								\
+} G_STMT_END
 
 
 
diff --git a/calendar/libedata-cal/e-data-cal-factory.c b/calendar/libedata-cal/e-data-cal-factory.c
index 905fe18..ce79269 100644
--- a/calendar/libedata-cal/e-data-cal-factory.c
+++ b/calendar/libedata-cal/e-data-cal-factory.c
@@ -345,9 +345,10 @@ impl_CalFactory_getCal (EDataCalFactory		*factory,
 	/* Find the associated backend factory (if any) */
 	backend_factory = get_backend_factory (priv->methods, uri->protocol, calobjtype_to_icalkind (type));
 	if (!backend_factory) {
-		gchar *msg = g_strdup_printf (_("No backend factory for '%s' of '%s'"), uri->protocol, calobjtype_to_string (type));
-		error = g_error_new (E_DATA_CAL_ERROR, NoSuchCal, msg);
-		g_free (msg);
+		error = g_error_new (
+			E_DATA_CAL_ERROR, NoSuchCal,
+			_("No backend factory for '%s' of '%s'"),
+			uri->protocol, calobjtype_to_string (type));
 
 		goto cleanup2;
 	}
@@ -658,7 +659,7 @@ e_data_cal_factory_dump_active_backends (EDataCalFactory *factory)
 }
 
 /* Convenience function to print an error and exit */
-static void
+G_GNUC_NORETURN static void
 die (const char *prefix, GError *error)
 {
 	g_error("%s: %s", prefix, error->message);
diff --git a/libedataserverui/e-categories-dialog.c b/libedataserverui/e-categories-dialog.c
index c49656a..63f9a07 100644
--- a/libedataserverui/e-categories-dialog.c
+++ b/libedataserverui/e-categories-dialog.c
@@ -89,7 +89,7 @@ static CategoryPropertiesDialog *
 load_properties_dialog (ECategoriesDialog *parent)
 {
 	CategoryPropertiesDialog *prop_dialog;
-	gchar *ui_to_load[] = { "properties-dialog", NULL };
+	const gchar *ui_to_load[] = { "properties-dialog", NULL };
 	gchar *uifile;
 	GError *error = NULL;
 
@@ -101,7 +101,7 @@ load_properties_dialog (ECategoriesDialog *parent)
 	prop_dialog->gui = gtk_builder_new ();
 	gtk_builder_set_translation_domain (prop_dialog->gui, GETTEXT_PACKAGE);
 	
-	if (!gtk_builder_add_objects_from_file (prop_dialog->gui, uifile, ui_to_load, &error)) {
+	if (!gtk_builder_add_objects_from_file (prop_dialog->gui, uifile, (gchar **) ui_to_load, &error)) {
 		g_object_unref (prop_dialog->gui);
 		g_free (prop_dialog);
 		g_free (uifile);
@@ -564,7 +564,7 @@ categories_dialog_init (ECategoriesDialog *dialog)
 	GtkWidget *main_widget;
 	GtkWidget *content_area;
 	gchar *uifile;
-	gchar *ui_to_load[] = {"table-categories", NULL};
+	const gchar *ui_to_load[] = {"table-categories", NULL};
 	GError *error = NULL;
 
 	dialog->priv = E_CATEGORIES_DIALOG_GET_PRIVATE (dialog);
@@ -577,7 +577,7 @@ categories_dialog_init (ECategoriesDialog *dialog)
 	dialog->priv->gui = gtk_builder_new ();
 	gtk_builder_set_translation_domain (dialog->priv->gui, GETTEXT_PACKAGE);
 
-	if (!gtk_builder_add_objects_from_file (dialog->priv->gui, uifile, ui_to_load, &error)) {
+	if (!gtk_builder_add_objects_from_file (dialog->priv->gui, uifile, (gchar **) ui_to_load, &error)) {
 		g_free (uifile);
 		g_object_unref (dialog->priv->gui);
 		dialog->priv->gui = NULL;



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