[glib/g-property: 21/25] gproperty: Remove a couple of unnecessary type checks
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/g-property: 21/25] gproperty: Remove a couple of unnecessary type checks
- Date: Wed, 17 Aug 2011 13:34:37 +0000 (UTC)
commit 1b9fd5b526dee5a74f423423c9075abf144b6634
Author: Emmanuele Bassi <ebassi linux intel com>
Date: Fri Jul 8 15:39:12 2011 +0100
gproperty: Remove a couple of unnecessary type checks
gobject/gproperty.c | 14 +++-----------
1 files changed, 3 insertions(+), 11 deletions(-)
---
diff --git a/gobject/gproperty.c b/gobject/gproperty.c
index 73072d5..0c8b072 100644
--- a/gobject/gproperty.c
+++ b/gobject/gproperty.c
@@ -815,7 +815,7 @@ static inline void
property_lock_internal (GProperty *property,
gpointer gobject)
{
- if ((property->flags & G_PROPERTY_ATOMIC) == 0)
+ if (G_LIKELY ((property->flags & G_PROPERTY_ATOMIC) == 0))
return;
if (property->lock_func != NULL)
@@ -828,7 +828,7 @@ static inline void
property_unlock_internal (GProperty *property,
gpointer gobject)
{
- if ((property->flags & G_PROPERTY_ATOMIC) == 0)
+ if (G_LIKELY ((property->flags & G_PROPERTY_ATOMIC) == 0))
return;
if (property->unlock_func != NULL)
@@ -4332,7 +4332,7 @@ g_property_set_valist (GProperty *property,
g_object_ref (gobject);
- gtype = G_PARAM_SPEC (property)->value_type;
+ gtype = ((GParamSpec *) property)->value_type;
switch (G_TYPE_FUNDAMENTAL (gtype))
{
@@ -4596,10 +4596,6 @@ g_property_set (GProperty *property,
va_list args;
gboolean res;
- g_return_val_if_fail (G_IS_PROPERTY (property), FALSE);
- g_return_val_if_fail (G_IS_OBJECT (gobject), FALSE);
- g_return_val_if_fail (property->is_installed, FALSE);
-
va_start (args, gobject);
res = g_property_set_valist (property, gobject, args);
va_end (args);
@@ -5053,10 +5049,6 @@ g_property_get (GProperty *property,
va_list args;
gboolean retval;
- g_return_val_if_fail (G_IS_PROPERTY (property), FALSE);
- g_return_val_if_fail (G_IS_OBJECT (gobject), FALSE);
- g_return_val_if_fail (property->is_installed, FALSE);
-
va_start (args, gobject);
retval = g_property_get_valist (property, gobject, args);
va_end (args);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]