From 2effc2aa01d1dd99f736075c12b5de15d070e8bf Mon Sep 17 00:00:00 2001 From: Peng Huang Date: Sat, 12 Dec 2009 13:34:57 +0800 Subject: [PATCH] Use g_assert to replace some g_return_ --- src/ibusattribute.c | 8 ++++---- src/ibusproperty.c | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/ibusattribute.c b/src/ibusattribute.c index 669aace..16738ea 100644 --- a/src/ibusattribute.c +++ b/src/ibusattribute.c @@ -288,7 +288,7 @@ ibus_attr_list_init (IBusAttrList *attr_list) static void ibus_attr_list_destroy (IBusAttrList *attr_list) { - g_return_if_fail (IBUS_IS_ATTR_LIST (attr_list)); + g_assert (IBUS_IS_ATTR_LIST (attr_list)); gint i; for (i = 0;; i++) { @@ -416,8 +416,8 @@ void ibus_attr_list_append (IBusAttrList *attr_list, IBusAttribute *attr) { - g_return_if_fail (IBUS_IS_ATTR_LIST (attr_list)); - g_return_if_fail (IBUS_IS_ATTRIBUTE (attr)); + g_assert (IBUS_IS_ATTR_LIST (attr_list)); + g_assert (IBUS_IS_ATTRIBUTE (attr)); g_object_ref (attr); g_array_append_val (attr_list->attributes, attr); @@ -427,7 +427,7 @@ IBusAttribute * ibus_attr_list_get (IBusAttrList *attr_list, guint index) { - g_return_val_if_fail (attr_list != NULL, NULL); + g_assert (IBUS_IS_ATTR_LIST (attr_list)); IBusAttribute *attr = NULL; if (index < attr_list->attributes->len) { diff --git a/src/ibusproperty.c b/src/ibusproperty.c index 1edec6c..7c3d2d2 100644 --- a/src/ibusproperty.c +++ b/src/ibusproperty.c @@ -324,7 +324,7 @@ ibus_property_set_tooltip (IBusProperty *prop, IBusText *tooltip) { g_assert (IBUS_IS_PROPERTY (prop)); - g_return_if_fail (tooltip == NULL || IBUS_IS_TEXT (tooltip)); + g_assert (tooltip == NULL || IBUS_IS_TEXT (tooltip)); if (prop->tooltip) { g_object_unref (prop->tooltip); @@ -359,9 +359,9 @@ ibus_property_set_state (IBusProperty *prop, IBusPropState state) { g_assert (IBUS_IS_PROPERTY (prop)); - g_return_if_fail (state == PROP_STATE_UNCHECKED || - state == PROP_STATE_CHECKED || - state == PROP_STATE_INCONSISTENT); + g_assert (state == PROP_STATE_UNCHECKED || + state == PROP_STATE_CHECKED || + state == PROP_STATE_INCONSISTENT); prop->state = state; } @@ -582,8 +582,8 @@ void ibus_prop_list_append (IBusPropList *prop_list, IBusProperty *prop) { - g_return_if_fail (IBUS_IS_PROP_LIST (prop_list)); - g_return_if_fail (IBUS_IS_PROPERTY (prop)); + g_assert (IBUS_IS_PROP_LIST (prop_list)); + g_assert (IBUS_IS_PROPERTY (prop)); g_object_ref (prop); @@ -594,7 +594,7 @@ IBusProperty * ibus_prop_list_get (IBusPropList *prop_list, guint index) { - g_return_val_if_fail (IBUS_IS_PROP_LIST (prop_list), NULL); + g_assert (IBUS_IS_PROP_LIST (prop_list)); if (index >= prop_list->properties->len) -- 2.7.4