From e7d6ad6d83acd3aba0dc11d4955339b20ccc8cf3 Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Fri, 31 Aug 2007 05:24:51 +0000 Subject: ** Move away from g_assert to g_return* calls svn path=/trunk/; revision=34143 --- mail/em-vfolder-rule.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'mail/em-vfolder-rule.c') diff --git a/mail/em-vfolder-rule.c b/mail/em-vfolder-rule.c index f8dbf8e593..0852712a08 100644 --- a/mail/em-vfolder-rule.c +++ b/mail/em-vfolder-rule.c @@ -142,7 +142,7 @@ em_vfolder_rule_new(void) void em_vfolder_rule_add_source(EMVFolderRule *vr, const char *uri) { - g_assert(EM_IS_VFOLDER_RULE(vr)); + g_return_if_fail (EM_IS_VFOLDER_RULE(vr)); g_return_if_fail (uri); vr->sources = g_list_append(vr->sources, g_strdup(uri)); @@ -155,7 +155,7 @@ em_vfolder_rule_find_source(EMVFolderRule *vr, const char *uri) { GList *l; - g_assert(EM_IS_VFOLDER_RULE(vr)); + g_return_val_if_fail (EM_IS_VFOLDER_RULE(vr), NULL); /* only does a simple string or address comparison, should probably do a decoded url comparison */ @@ -174,7 +174,7 @@ em_vfolder_rule_remove_source(EMVFolderRule *vr, const char *uri) { char *found; - g_assert(EM_IS_VFOLDER_RULE(vr)); + g_return_if_fail (EM_IS_VFOLDER_RULE(vr)); found =(char *)em_vfolder_rule_find_source(vr, uri); if (found) { @@ -256,9 +256,11 @@ xml_encode(FilterRule *fr) EMVFolderRule *vr =(EMVFolderRule *)fr; xmlNodePtr node, set, work; GList *l; + node = FILTER_RULE_CLASS(parent_class)->xml_encode(fr); - g_assert(node != NULL); - g_assert(vr->with >= 0 && vr->with < sizeof(with_names)/sizeof(with_names[0])); + g_return_val_if_fail (node != NULL, NULL); + g_return_val_if_fail (vr->with >= 0 && vr->with < sizeof(with_names)/sizeof(with_names[0]), NULL); + set = xmlNewNode(NULL, (const unsigned char *)"sources"); xmlAddChild(node, set); xmlSetProp(set, (const unsigned char *)"with", (unsigned char *)with_names[vr->with]); -- cgit