[evolution-data-server/imapx-extensible: 9/10] IMAPX: (utils) use g_return_if_fail() family of functions instead of g_assert()



commit 9036c6dda4653bf0cb7c4fa48c2815fec2856129
Author: Christian Hilberg <chilberg src gnome org>
Date:   Tue Jun 26 16:32:53 2012 +0200

    IMAPX: (utils) use g_return_if_fail() family of functions instead of g_assert()
    
    * changed the function param sanity checking from assertions
      to the g_return*_if_fail() family of functions, so we can
      stumble along instead of barfing in front of the user

 camel/camel-imapx-utils.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/camel/camel-imapx-utils.c b/camel/camel-imapx-utils.c
index 4a7f2cc..cc3feb8 100644
--- a/camel/camel-imapx-utils.c
+++ b/camel/camel-imapx-utils.c
@@ -479,7 +479,7 @@ imapx_register_capability (const gchar *capability)
 	GList *keys = NULL;
 	GList *tmp_keys = NULL;
 
-	g_assert (capability != NULL);
+	g_return_val_if_fail (capability != NULL, 0);
 
 	g_mutex_lock (&capa_htable_lock);
 
@@ -504,7 +504,7 @@ imapx_register_capability (const gchar *capability)
 
 	/* shift-left biggest-so-far, sanity-check */
 	check_id = (capa_id << 1);
-	g_assert (check_id <= (guint64) G_MAXUINT32);
+	g_return_val_if_fail (check_id <= (guint64) G_MAXUINT32, 0);
 	capa_id = (guint32) check_id;
 
 	/* insert */



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