[glib/mcatanzaro/gtype-criticals: 24/24] Replace most GObject warnings with criticals
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/mcatanzaro/gtype-criticals: 24/24] Replace most GObject warnings with criticals
- Date: Tue, 9 Aug 2022 18:19:00 +0000 (UTC)
commit 0ffe86a1f7e215e4561c3b9f1d03c3cd638ed00f
Author: Michael Catanzaro <mcatanzaro redhat com>
Date: Wed Aug 3 18:35:33 2022 -0500
Replace most GObject warnings with criticals
All of these warnings indicate programmer error, so critical is most
appropriate here.
Exceptions: deprecation warnings are just warnings. Also, warnings that
are worded with uncertainty can remain warnings rather than criticals.
gio/tests/glistmodel.c | 2 +-
gobject/gbinding.c | 84 +++++-----
gobject/gclosure.c | 26 ++--
gobject/gobject.c | 84 +++++-----
gobject/gobjectnotifyqueue.c | 4 +-
gobject/gparam.c | 4 +-
gobject/gsignal.c | 164 ++++++++++----------
gobject/gtype.c | 354 +++++++++++++++++++++----------------------
gobject/gtypemodule.c | 31 ++--
gobject/gvalue.c | 20 +--
gobject/tests/binding.c | 2 +-
gobject/tests/properties.c | 2 +-
gobject/tests/signals.c | 8 +-
gobject/tests/type-flags.c | 2 +-
14 files changed, 393 insertions(+), 394 deletions(-)
---
diff --git a/gio/tests/glistmodel.c b/gio/tests/glistmodel.c
index ee61d1d501..049c8e4a8e 100644
--- a/gio/tests/glistmodel.c
+++ b/gio/tests/glistmodel.c
@@ -73,7 +73,7 @@ test_store_non_gobjects (void)
g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
- g_test_trap_assert_stderr ("*WARNING*value * of type 'GType' is invalid or "
+ g_test_trap_assert_stderr ("*CRITICAL*value * of type 'GType' is invalid or "
"out of range for property 'item-type'*");
}
diff --git a/gobject/gbinding.c b/gobject/gbinding.c
index 2ef024545f..54dd0c2534 100644
--- a/gobject/gbinding.c
+++ b/gobject/gbinding.c
@@ -464,11 +464,11 @@ default_transform (GBinding *binding,
return TRUE;
}
- g_warning ("%s: Unable to convert a value of type %s to a "
- "value of type %s",
- G_STRLOC,
- g_type_name (G_VALUE_TYPE (value_a)),
- g_type_name (G_VALUE_TYPE (value_b)));
+ g_critical ("%s: Unable to convert a value of type %s to a "
+ "value of type %s",
+ G_STRLOC,
+ g_type_name (G_VALUE_TYPE (value_a)),
+ g_type_name (G_VALUE_TYPE (value_b)));
return FALSE;
}
@@ -1253,7 +1253,7 @@ g_object_bind_property_full (gpointer source,
if (source == target && g_strcmp0 (source_property, target_property) == 0)
{
- g_warning ("Unable to bind the same property on the same instance");
+ g_critical ("Unable to bind the same property on the same instance");
return NULL;
}
@@ -1269,82 +1269,82 @@ g_object_bind_property_full (gpointer source,
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (source), source_property);
if (pspec == NULL)
{
- g_warning ("%s: The source object of type %s has no property called '%s'",
- G_STRLOC,
- G_OBJECT_TYPE_NAME (source),
- source_property);
+ g_critical ("%s: The source object of type %s has no property called '%s'",
+ G_STRLOC,
+ G_OBJECT_TYPE_NAME (source),
+ source_property);
return NULL;
}
if (!(pspec->flags & G_PARAM_READABLE))
{
- g_warning ("%s: The source object of type %s has no readable property called '%s'",
- G_STRLOC,
- G_OBJECT_TYPE_NAME (source),
- source_property);
+ g_critical ("%s: The source object of type %s has no readable property called '%s'",
+ G_STRLOC,
+ G_OBJECT_TYPE_NAME (source),
+ source_property);
return NULL;
}
if ((flags & G_BINDING_BIDIRECTIONAL) &&
((pspec->flags & G_PARAM_CONSTRUCT_ONLY) || !(pspec->flags & G_PARAM_WRITABLE)))
{
- g_warning ("%s: The source object of type %s has no writable property called '%s'",
- G_STRLOC,
- G_OBJECT_TYPE_NAME (source),
- source_property);
+ g_critical ("%s: The source object of type %s has no writable property called '%s'",
+ G_STRLOC,
+ G_OBJECT_TYPE_NAME (source),
+ source_property);
return NULL;
}
if ((flags & G_BINDING_INVERT_BOOLEAN) &&
!(G_PARAM_SPEC_VALUE_TYPE (pspec) == G_TYPE_BOOLEAN))
{
- g_warning ("%s: The G_BINDING_INVERT_BOOLEAN flag can only be used "
- "when binding boolean properties; the source property '%s' "
- "is of type '%s'",
- G_STRLOC,
- source_property,
- g_type_name (G_PARAM_SPEC_VALUE_TYPE (pspec)));
+ g_critical ("%s: The G_BINDING_INVERT_BOOLEAN flag can only be used "
+ "when binding boolean properties; the source property '%s' "
+ "is of type '%s'",
+ G_STRLOC,
+ source_property,
+ g_type_name (G_PARAM_SPEC_VALUE_TYPE (pspec)));
return NULL;
}
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (target), target_property);
if (pspec == NULL)
{
- g_warning ("%s: The target object of type %s has no property called '%s'",
- G_STRLOC,
- G_OBJECT_TYPE_NAME (target),
- target_property);
+ g_critical ("%s: The target object of type %s has no property called '%s'",
+ G_STRLOC,
+ G_OBJECT_TYPE_NAME (target),
+ target_property);
return NULL;
}
if ((pspec->flags & G_PARAM_CONSTRUCT_ONLY) || !(pspec->flags & G_PARAM_WRITABLE))
{
- g_warning ("%s: The target object of type %s has no writable property called '%s'",
- G_STRLOC,
- G_OBJECT_TYPE_NAME (target),
- target_property);
+ g_critical ("%s: The target object of type %s has no writable property called '%s'",
+ G_STRLOC,
+ G_OBJECT_TYPE_NAME (target),
+ target_property);
return NULL;
}
if ((flags & G_BINDING_BIDIRECTIONAL) &&
!(pspec->flags & G_PARAM_READABLE))
{
- g_warning ("%s: The target object of type %s has no readable property called '%s'",
- G_STRLOC,
- G_OBJECT_TYPE_NAME (target),
- target_property);
+ g_critical ("%s: The target object of type %s has no readable property called '%s'",
+ G_STRLOC,
+ G_OBJECT_TYPE_NAME (target),
+ target_property);
return NULL;
}
if ((flags & G_BINDING_INVERT_BOOLEAN) &&
!(G_PARAM_SPEC_VALUE_TYPE (pspec) == G_TYPE_BOOLEAN))
{
- g_warning ("%s: The G_BINDING_INVERT_BOOLEAN flag can only be used "
- "when binding boolean properties; the target property '%s' "
- "is of type '%s'",
- G_STRLOC,
- target_property,
- g_type_name (G_PARAM_SPEC_VALUE_TYPE (pspec)));
+ g_critical ("%s: The G_BINDING_INVERT_BOOLEAN flag can only be used "
+ "when binding boolean properties; the target property '%s' "
+ "is of type '%s'",
+ G_STRLOC,
+ target_property,
+ g_type_name (G_PARAM_SPEC_VALUE_TYPE (pspec)));
return NULL;
}
diff --git a/gobject/gclosure.c b/gobject/gclosure.c
index 3abec05616..cdbcdd9652 100644
--- a/gobject/gclosure.c
+++ b/gobject/gclosure.c
@@ -748,8 +748,8 @@ g_closure_remove_invalidate_notifier (GClosure *closure,
closure->data == notify_data)
closure->marshal = NULL;
else if (!closure_try_remove_inotify (closure, notify_data, notify_func))
- g_warning (G_STRLOC ": unable to remove uninstalled invalidation notifier: %p (%p)",
- notify_func, notify_data);
+ g_critical (G_STRLOC ": unable to remove uninstalled invalidation notifier: %p (%p)",
+ notify_func, notify_data);
}
/**
@@ -776,8 +776,8 @@ g_closure_remove_finalize_notifier (GClosure *closure,
closure->data == notify_data)
closure->marshal = NULL;
else if (!closure_try_remove_fnotify (closure, notify_data, notify_func))
- g_warning (G_STRLOC ": unable to remove uninstalled finalization notifier: %p (%p)",
- notify_func, notify_data);
+ g_critical (G_STRLOC ": unable to remove uninstalled finalization notifier: %p (%p)",
+ notify_func, notify_data);
}
/**
@@ -929,8 +929,8 @@ g_closure_set_marshal (GClosure *closure,
g_return_if_fail (marshal != NULL);
if (closure->marshal && closure->marshal != marshal)
- g_warning ("attempt to override closure->marshal (%p) with new marshal (%p)",
- closure->marshal, marshal);
+ g_critical ("attempt to override closure->marshal (%p) with new marshal (%p)",
+ closure->marshal, marshal);
else
closure->marshal = marshal;
}
@@ -947,8 +947,8 @@ _g_closure_set_va_marshal (GClosure *closure,
real_closure = G_REAL_CLOSURE (closure);
if (real_closure->va_marshal && real_closure->va_marshal != marshal)
- g_warning ("attempt to override closure->va_marshal (%p) with new marshal (%p)",
- real_closure->va_marshal, marshal);
+ g_critical ("attempt to override closure->va_marshal (%p) with new marshal (%p)",
+ real_closure->va_marshal, marshal);
else
real_closure->va_marshal = marshal;
}
@@ -1274,7 +1274,7 @@ value_to_ffi_type (const GValue *gvalue,
default:
rettype = &ffi_type_pointer;
*value = NULL;
- g_warning ("value_to_ffi_type: Unsupported fundamental type: %s", g_type_name (type));
+ g_critical ("value_to_ffi_type: Unsupported fundamental type: %s", g_type_name (type));
break;
}
return rettype;
@@ -1354,9 +1354,9 @@ restart:
goto restart;
G_GNUC_FALLTHROUGH;
default:
- g_warning ("value_from_ffi_type: Unsupported fundamental type %s for type %s",
- g_type_name (g_type_fundamental (G_VALUE_TYPE (gvalue))),
- g_type_name (G_VALUE_TYPE (gvalue)));
+ g_critical ("value_from_ffi_type: Unsupported fundamental type %s for type %s",
+ g_type_name (g_type_fundamental (G_VALUE_TYPE (gvalue))),
+ g_type_name (G_VALUE_TYPE (gvalue)));
}
}
@@ -1434,7 +1434,7 @@ va_to_ffi_type (GType gtype,
default:
rettype = &ffi_type_pointer;
storage->_guint64 = 0;
- g_warning ("va_to_ffi_type: Unsupported fundamental type: %s", g_type_name (type));
+ g_critical ("va_to_ffi_type: Unsupported fundamental type: %s", g_type_name (type));
break;
}
return rettype;
diff --git a/gobject/gobject.c b/gobject/gobject.c
index f743e589ad..76a18be042 100644
--- a/gobject/gobject.c
+++ b/gobject/gobject.c
@@ -333,8 +333,8 @@ g_object_notify_queue_thaw (GObject *object,
if (G_UNLIKELY (nqueue->freeze_count == 0))
{
G_UNLOCK (notify_lock);
- g_warning ("%s: property-changed notification for %s(%p) is not frozen",
- G_STRFUNC, G_OBJECT_TYPE_NAME (object), object);
+ g_critical ("%s: property-changed notification for %s(%p) is not frozen",
+ G_STRFUNC, G_OBJECT_TYPE_NAME (object), object);
return;
}
@@ -598,9 +598,9 @@ install_property_internal (GType g_type,
if (g_param_spec_pool_lookup (pspec_pool, pspec->name, g_type, FALSE))
{
- g_warning ("When installing property: type '%s' already has a property named '%s'",
- g_type_name (g_type),
- pspec->name);
+ g_critical ("When installing property: type '%s' already has a property named '%s'",
+ g_type_name (g_type),
+ pspec->name);
g_param_spec_unref (pspec);
return FALSE;
}
@@ -1096,8 +1096,8 @@ g_object_class_override_property (GObjectClass *oclass,
if (!overridden)
{
- g_warning ("%s: Can't find property to override for '%s::%s'",
- G_STRFUNC, G_OBJECT_CLASS_NAME (oclass), name);
+ g_critical ("%s: Can't find property to override for '%s::%s'",
+ G_STRFUNC, G_OBJECT_CLASS_NAME (oclass), name);
return;
}
@@ -1586,10 +1586,10 @@ g_object_notify (GObject *object,
TRUE);
if (!pspec)
- g_warning ("%s: object class '%s' has no property named '%s'",
- G_STRFUNC,
- G_OBJECT_TYPE_NAME (object),
- property_name);
+ g_critical ("%s: object class '%s' has no property named '%s'",
+ G_STRFUNC,
+ G_OBJECT_TYPE_NAME (object),
+ property_name);
else
g_object_notify_by_spec_internal (object, pspec);
}
@@ -1799,19 +1799,19 @@ object_set_property (GObject *object,
g_value_init (&tmp_value, pspec->value_type);
if (!g_value_transform (value, &tmp_value))
- g_warning ("unable to set property '%s' of type '%s' from value of type '%s'",
- pspec->name,
- g_type_name (pspec->value_type),
- G_VALUE_TYPE_NAME (value));
+ g_critical ("unable to set property '%s' of type '%s' from value of type '%s'",
+ pspec->name,
+ g_type_name (pspec->value_type),
+ G_VALUE_TYPE_NAME (value));
else if (g_param_value_validate (pspec, &tmp_value) && !(pspec->flags & G_PARAM_LAX_VALIDATION))
{
gchar *contents = g_strdup_value_contents (value);
- g_warning ("value \"%s\" of type '%s' is invalid or out of range for property '%s' of type '%s'",
- contents,
- G_VALUE_TYPE_NAME (value),
- pspec->name,
- g_type_name (pspec->value_type));
+ g_critical ("value \"%s\" of type '%s' is invalid or out of range for property '%s' of type '%s'",
+ contents,
+ G_VALUE_TYPE_NAME (value),
+ pspec->name,
+ g_type_name (pspec->value_type));
g_free (contents);
}
else
@@ -2635,20 +2635,20 @@ g_object_set_is_valid_property (GObject *object,
{
if (G_UNLIKELY (pspec == NULL))
{
- g_warning ("%s: object class '%s' has no property named '%s'",
- G_STRFUNC, G_OBJECT_TYPE_NAME (object), property_name);
+ g_critical ("%s: object class '%s' has no property named '%s'",
+ G_STRFUNC, G_OBJECT_TYPE_NAME (object), property_name);
return FALSE;
}
if (G_UNLIKELY (!(pspec->flags & G_PARAM_WRITABLE)))
{
- g_warning ("%s: property '%s' of object class '%s' is not writable",
- G_STRFUNC, pspec->name, G_OBJECT_TYPE_NAME (object));
+ g_critical ("%s: property '%s' of object class '%s' is not writable",
+ G_STRFUNC, pspec->name, G_OBJECT_TYPE_NAME (object));
return FALSE;
}
if (G_UNLIKELY (((pspec->flags & G_PARAM_CONSTRUCT_ONLY) && !object_in_construction (object))))
{
- g_warning ("%s: construct property \"%s\" for object '%s' can't be set after construction",
- G_STRFUNC, pspec->name, G_OBJECT_TYPE_NAME (object));
+ g_critical ("%s: construct property \"%s\" for object '%s' can't be set after construction",
+ G_STRFUNC, pspec->name, G_OBJECT_TYPE_NAME (object));
return FALSE;
}
return TRUE;
@@ -2750,7 +2750,7 @@ g_object_set_valist (GObject *object,
G_VALUE_COLLECT_INIT2 (&value, vtab, pspec->value_type, var_args, G_VALUE_NOCOPY_CONTENTS, &error);
if (error)
{
- g_warning ("%s: %s", G_STRFUNC, error);
+ g_critical ("%s: %s", G_STRFUNC, error);
g_free (error);
g_value_unset (&value);
break;
@@ -2780,14 +2780,14 @@ g_object_get_is_valid_property (GObject *object,
{
if (G_UNLIKELY (pspec == NULL))
{
- g_warning ("%s: object class '%s' has no property named '%s'",
- G_STRFUNC, G_OBJECT_TYPE_NAME (object), property_name);
+ g_critical ("%s: object class '%s' has no property named '%s'",
+ G_STRFUNC, G_OBJECT_TYPE_NAME (object), property_name);
return FALSE;
}
if (G_UNLIKELY (!(pspec->flags & G_PARAM_READABLE)))
{
- g_warning ("%s: property '%s' of object class '%s' is not readable",
- G_STRFUNC, pspec->name, G_OBJECT_TYPE_NAME (object));
+ g_critical ("%s: property '%s' of object class '%s' is not readable",
+ G_STRFUNC, pspec->name, G_OBJECT_TYPE_NAME (object));
return FALSE;
}
return TRUE;
@@ -2889,7 +2889,7 @@ g_object_get_valist (GObject *object,
G_VALUE_LCOPY (&value, var_args, 0, &error);
if (error)
{
- g_warning ("%s: %s", G_STRFUNC, error);
+ g_critical ("%s: %s", G_STRFUNC, error);
g_free (error);
g_value_unset (&value);
break;
@@ -3057,10 +3057,10 @@ g_object_get_property (GObject *object,
}
else if (!g_value_type_transformable (pspec->value_type, G_VALUE_TYPE (value)))
{
- g_warning ("%s: can't retrieve property '%s' of type '%s' as value of type '%s'",
- G_STRFUNC, pspec->name,
- g_type_name (pspec->value_type),
- G_VALUE_TYPE_NAME (value));
+ g_critical ("%s: can't retrieve property '%s' of type '%s' as value of type '%s'",
+ G_STRFUNC, pspec->name,
+ g_type_name (pspec->value_type),
+ G_VALUE_TYPE_NAME (value));
g_object_unref (object);
return;
}
@@ -3172,7 +3172,7 @@ g_object_connect (gpointer _object,
G_CONNECT_SWAPPED | G_CONNECT_AFTER);
else
{
- g_warning ("%s: invalid signal spec \"%s\"", G_STRFUNC, signal_spec);
+ g_critical ("%s: invalid signal spec \"%s\"", G_STRFUNC, signal_spec);
break;
}
signal_spec = va_arg (var_args, gchar*);
@@ -3229,17 +3229,17 @@ g_object_disconnect (gpointer _object,
}
else
{
- g_warning ("%s: invalid signal spec \"%s\"", G_STRFUNC, signal_spec);
+ g_critical ("%s: invalid signal spec \"%s\"", G_STRFUNC, signal_spec);
break;
}
if ((mask & G_SIGNAL_MATCH_ID) &&
!g_signal_parse_name (signal_spec, G_OBJECT_TYPE (object), &sid, &detail, FALSE))
- g_warning ("%s: invalid signal name \"%s\"", G_STRFUNC, signal_spec);
+ g_critical ("%s: invalid signal name \"%s\"", G_STRFUNC, signal_spec);
else if (!g_signal_handlers_disconnect_matched (object, mask | (detail ? G_SIGNAL_MATCH_DETAIL : 0),
sid, detail,
NULL, (gpointer)callback, data))
- g_warning ("%s: signal handler %p(%p) is not connected", G_STRFUNC, callback, data);
+ g_critical ("%s: signal handler %p(%p) is not connected", G_STRFUNC, callback, data);
signal_spec = va_arg (var_args, gchar*);
}
va_end (var_args);
@@ -3353,7 +3353,7 @@ g_object_weak_unref (GObject *object,
}
G_UNLOCK (weak_refs_mutex);
if (!found_one)
- g_warning ("%s: couldn't find weak ref %p(%p)", G_STRFUNC, notify, data);
+ g_critical ("%s: couldn't find weak ref %p(%p)", G_STRFUNC, notify, data);
}
/**
@@ -3727,7 +3727,7 @@ g_object_remove_toggle_ref (GObject *object,
if (found_one)
g_object_unref (object);
else
- g_warning ("%s: couldn't find toggle ref %p(%p)", G_STRFUNC, notify, data);
+ g_critical ("%s: couldn't find toggle ref %p(%p)", G_STRFUNC, notify, data);
}
/**
diff --git a/gobject/gobjectnotifyqueue.c b/gobject/gobjectnotifyqueue.c
index 48d09ec14a..6ed6f51ad6 100644
--- a/gobject/gobjectnotifyqueue.c
+++ b/gobject/gobjectnotifyqueue.c
@@ -113,8 +113,8 @@ g_object_notify_queue_thaw (GObject *object,
/* Just make sure we never get into some nasty race condition */
if (G_UNLIKELY(nqueue->freeze_count == 0)) {
G_UNLOCK(notify_lock);
- g_warning ("%s: property-changed notification for %s(%p) is not frozen",
- G_STRFUNC, G_OBJECT_TYPE_NAME (object), object);
+ g_critical ("%s: property-changed notification for %s(%p) is not frozen",
+ G_STRFUNC, G_OBJECT_TYPE_NAME (object), object);
return;
}
diff --git a/gobject/gparam.c b/gobject/gparam.c
index 14238521b1..040dc96357 100644
--- a/gobject/gparam.c
+++ b/gobject/gparam.c
@@ -1021,7 +1021,7 @@ g_param_spec_pool_insert (GParamSpecPool *pool,
{
if (!strchr (G_CSET_A_2_Z G_CSET_a_2_z G_CSET_DIGITS "-_", *p))
{
- g_warning (G_STRLOC ": pspec name \"%s\" contains invalid characters", pspec->name);
+ g_critical (G_STRLOC ": pspec name \"%s\" contains invalid characters", pspec->name);
return;
}
}
@@ -1057,7 +1057,7 @@ g_param_spec_pool_remove (GParamSpecPool *pool,
if (g_hash_table_remove (pool->hash_table, pspec))
g_param_spec_unref (pspec);
else
- g_warning (G_STRLOC ": attempt to remove unknown pspec '%s' from pool", pspec->name);
+ g_critical (G_STRLOC ": attempt to remove unknown pspec '%s' from pool", pspec->name);
g_mutex_unlock (&pool->mutex);
}
else
diff --git a/gobject/gsignal.c b/gobject/gsignal.c
index 32453bc519..b4658b0a6d 100644
--- a/gobject/gsignal.c
+++ b/gobject/gsignal.c
@@ -955,9 +955,9 @@ _g_signals_destroy (GType itype)
if (node->itype == itype)
{
if (node->destroyed)
- g_warning (G_STRLOC ": signal \"%s\" of type '%s' already destroyed",
- node->name,
- type_debug_name (node->itype));
+ g_critical (G_STRLOC ": signal \"%s\" of type '%s' already destroyed",
+ node->name,
+ type_debug_name (node->itype));
else
signal_destroy_R (node);
}
@@ -993,7 +993,7 @@ g_signal_stop_emission (gpointer instance,
node = LOOKUP_SIGNAL_NODE (signal_id);
if (node && detail && !(node->flags & G_SIGNAL_DETAILED))
{
- g_warning ("%s: signal id '%u' does not support detail (%u)", G_STRLOC, signal_id, detail);
+ g_critical ("%s: signal id '%u' does not support detail (%u)", G_STRLOC, signal_id, detail);
SIGNAL_UNLOCK ();
return;
}
@@ -1004,17 +1004,17 @@ g_signal_stop_emission (gpointer instance,
if (emission)
{
if (emission->state == EMISSION_HOOK)
- g_warning (G_STRLOC ": emission of signal \"%s\" for instance '%p' cannot be stopped from
emission hook",
- node->name, instance);
+ g_critical (G_STRLOC ": emission of signal \"%s\" for instance '%p' cannot be stopped from
emission hook",
+ node->name, instance);
else if (emission->state == EMISSION_RUN)
emission->state = EMISSION_STOP;
}
else
- g_warning (G_STRLOC ": no emission of signal \"%s\" to stop for instance '%p'",
- node->name, instance);
+ g_critical (G_STRLOC ": no emission of signal \"%s\" to stop for instance '%p'",
+ node->name, instance);
}
else
- g_warning ("%s: signal id '%u' is invalid for instance '%p'", G_STRLOC, signal_id, instance);
+ g_critical ("%s: signal id '%u' is invalid for instance '%p'", G_STRLOC, signal_id, instance);
SIGNAL_UNLOCK ();
}
@@ -1066,19 +1066,19 @@ g_signal_add_emission_hook (guint signal_id,
node = LOOKUP_SIGNAL_NODE (signal_id);
if (!node || node->destroyed)
{
- g_warning ("%s: invalid signal id '%u'", G_STRLOC, signal_id);
+ g_critical ("%s: invalid signal id '%u'", G_STRLOC, signal_id);
SIGNAL_UNLOCK ();
return 0;
}
if (node->flags & G_SIGNAL_NO_HOOKS)
{
- g_warning ("%s: signal id '%u' does not support emission hooks (G_SIGNAL_NO_HOOKS flag set)",
G_STRLOC, signal_id);
+ g_critical ("%s: signal id '%u' does not support emission hooks (G_SIGNAL_NO_HOOKS flag set)",
G_STRLOC, signal_id);
SIGNAL_UNLOCK ();
return 0;
}
if (detail && !(node->flags & G_SIGNAL_DETAILED))
{
- g_warning ("%s: signal id '%u' does not support detail (%u)", G_STRLOC, signal_id, detail);
+ g_critical ("%s: signal id '%u' does not support detail (%u)", G_STRLOC, signal_id, detail);
SIGNAL_UNLOCK ();
return 0;
}
@@ -1128,11 +1128,11 @@ g_signal_remove_emission_hook (guint signal_id,
node = LOOKUP_SIGNAL_NODE (signal_id);
if (!node || node->destroyed)
{
- g_warning ("%s: invalid signal id '%u'", G_STRLOC, signal_id);
+ g_critical ("%s: invalid signal id '%u'", G_STRLOC, signal_id);
goto out;
}
else if (!node->emission_hooks || !g_hook_destroy (node->emission_hooks, hook_id))
- g_warning ("%s: signal \"%s\" had no hook (%lu) to remove", G_STRLOC, node->name, hook_id);
+ g_critical ("%s: signal \"%s\" had no hook (%lu) to remove", G_STRLOC, node->name, hook_id);
node->single_va_closure_is_valid = FALSE;
@@ -1265,10 +1265,10 @@ g_signal_stop_emission_by_name (gpointer instance,
SignalNode *node = LOOKUP_SIGNAL_NODE (signal_id);
if (detail && !(node->flags & G_SIGNAL_DETAILED))
- g_warning ("%s: signal '%s' does not support details", G_STRLOC, detailed_signal);
+ g_critical ("%s: signal '%s' does not support details", G_STRLOC, detailed_signal);
else if (!g_type_is_a (itype, node->itype))
- g_warning ("%s: signal '%s' is invalid for instance '%p' of type '%s'",
- G_STRLOC, detailed_signal, instance, g_type_name (itype));
+ g_critical ("%s: signal '%s' is invalid for instance '%p' of type '%s'",
+ G_STRLOC, detailed_signal, instance, g_type_name (itype));
else
{
Emission *emission = emission_find (signal_id, detail, instance);
@@ -1276,19 +1276,19 @@ g_signal_stop_emission_by_name (gpointer instance,
if (emission)
{
if (emission->state == EMISSION_HOOK)
- g_warning (G_STRLOC ": emission of signal \"%s\" for instance '%p' cannot be stopped from
emission hook",
- node->name, instance);
+ g_critical (G_STRLOC ": emission of signal \"%s\" for instance '%p' cannot be stopped from
emission hook",
+ node->name, instance);
else if (emission->state == EMISSION_RUN)
emission->state = EMISSION_STOP;
}
else
- g_warning (G_STRLOC ": no emission of signal \"%s\" to stop for instance '%p'",
- node->name, instance);
+ g_critical (G_STRLOC ": no emission of signal \"%s\" to stop for instance '%p'",
+ node->name, instance);
}
}
else
- g_warning ("%s: signal '%s' is invalid for instance '%p' of type '%s'",
- G_STRLOC, detailed_signal, instance, g_type_name (itype));
+ g_critical ("%s: signal '%s' is invalid for instance '%p' of type '%s'",
+ G_STRLOC, detailed_signal, instance, g_type_name (itype));
SIGNAL_UNLOCK ();
}
@@ -1326,11 +1326,11 @@ g_signal_lookup (const gchar *name,
{
/* give elaborate warnings */
if (!g_type_name (itype))
- g_warning (G_STRLOC ": unable to look up signal \"%s\" for invalid type id '%"G_GSIZE_FORMAT"'",
- name, itype);
+ g_critical (G_STRLOC ": unable to look up signal \"%s\" for invalid type id '%"G_GSIZE_FORMAT"'",
+ name, itype);
else if (!g_signal_is_valid_name (name))
- g_warning (G_STRLOC ": unable to look up invalid signal name \"%s\" on type '%s'",
- name, g_type_name (itype));
+ g_critical (G_STRLOC ": unable to look up invalid signal name \"%s\" on type '%s'",
+ name, g_type_name (itype));
}
return signal_id;
@@ -1375,14 +1375,14 @@ g_signal_list_ids (GType itype,
{
/* give elaborate warnings */
if (!g_type_name (itype))
- g_warning (G_STRLOC ": unable to list signals for invalid type id '%"G_GSIZE_FORMAT"'",
- itype);
+ g_critical (G_STRLOC ": unable to list signals for invalid type id '%"G_GSIZE_FORMAT"'",
+ itype);
else if (!G_TYPE_IS_INSTANTIATABLE (itype) && !G_TYPE_IS_INTERFACE (itype))
- g_warning (G_STRLOC ": unable to list signals of non instantiatable type '%s'",
- g_type_name (itype));
+ g_critical (G_STRLOC ": unable to list signals of non instantiatable type '%s'",
+ g_type_name (itype));
else if (!g_type_class_peek (itype) && !G_TYPE_IS_INTERFACE (itype))
- g_warning (G_STRLOC ": unable to list signals of unloaded type '%s'",
- g_type_name (itype));
+ g_critical (G_STRLOC ": unable to list signals of unloaded type '%s'",
+ g_type_name (itype));
}
return (guint*) g_array_free (result, FALSE);
@@ -1743,20 +1743,20 @@ g_signal_newv (const gchar *signal_name,
node = LOOKUP_SIGNAL_NODE (signal_id);
if (node && !node->destroyed)
{
- g_warning (G_STRLOC ": signal \"%s\" already exists in the '%s' %s",
- name,
- type_debug_name (node->itype),
- G_TYPE_IS_INTERFACE (node->itype) ? "interface" : "class ancestry");
+ g_critical (G_STRLOC ": signal \"%s\" already exists in the '%s' %s",
+ name,
+ type_debug_name (node->itype),
+ G_TYPE_IS_INTERFACE (node->itype) ? "interface" : "class ancestry");
g_free (signal_name_copy);
SIGNAL_UNLOCK ();
return 0;
}
if (node && node->itype != itype)
{
- g_warning (G_STRLOC ": signal \"%s\" for type '%s' was previously created for type '%s'",
- name,
- type_debug_name (itype),
- type_debug_name (node->itype));
+ g_critical (G_STRLOC ": signal \"%s\" for type '%s' was previously created for type '%s'",
+ name,
+ type_debug_name (itype),
+ type_debug_name (node->itype));
g_free (signal_name_copy);
SIGNAL_UNLOCK ();
return 0;
@@ -1764,16 +1764,16 @@ g_signal_newv (const gchar *signal_name,
for (i = 0; i < n_params; i++)
if (!G_TYPE_IS_VALUE (param_types[i] & ~G_SIGNAL_TYPE_STATIC_SCOPE))
{
- g_warning (G_STRLOC ": parameter %d of type '%s' for signal \"%s::%s\" is not a value type",
- i + 1, type_debug_name (param_types[i]), type_debug_name (itype), name);
+ g_critical (G_STRLOC ": parameter %d of type '%s' for signal \"%s::%s\" is not a value type",
+ i + 1, type_debug_name (param_types[i]), type_debug_name (itype), name);
g_free (signal_name_copy);
SIGNAL_UNLOCK ();
return 0;
}
if (return_type != G_TYPE_NONE && !G_TYPE_IS_VALUE (return_type & ~G_SIGNAL_TYPE_STATIC_SCOPE))
{
- g_warning (G_STRLOC ": return value of type '%s' for signal \"%s::%s\" is not a value type",
- type_debug_name (return_type), type_debug_name (itype), name);
+ g_critical (G_STRLOC ": return value of type '%s' for signal \"%s::%s\" is not a value type",
+ type_debug_name (return_type), type_debug_name (itype), name);
g_free (signal_name_copy);
SIGNAL_UNLOCK ();
return 0;
@@ -2079,13 +2079,13 @@ g_signal_override_class_closure (guint signal_id,
node = LOOKUP_SIGNAL_NODE (signal_id);
node_check_deprecated (node);
if (!g_type_is_a (instance_type, node->itype))
- g_warning ("%s: type '%s' cannot be overridden for signal id '%u'", G_STRLOC, type_debug_name
(instance_type), signal_id);
+ g_critical ("%s: type '%s' cannot be overridden for signal id '%u'", G_STRLOC, type_debug_name
(instance_type), signal_id);
else
{
ClassClosure *cc = signal_find_class_closure (node, instance_type);
if (cc && cc->instance_type == instance_type)
- g_warning ("%s: type '%s' is already overridden for signal id '%u'", G_STRLOC, type_debug_name
(instance_type), signal_id);
+ g_critical ("%s: type '%s' is already overridden for signal id '%u'", G_STRLOC, type_debug_name
(instance_type), signal_id);
else
signal_add_class_closure (node, instance_type, class_closure);
}
@@ -2127,8 +2127,8 @@ g_signal_override_class_handler (const gchar *signal_name,
g_signal_override_class_closure (signal_id, instance_type,
g_cclosure_new (class_handler, NULL, NULL));
else
- g_warning ("%s: signal name '%s' is invalid for type id '%"G_GSIZE_FORMAT"'",
- G_STRLOC, signal_name, instance_type);
+ g_critical ("%s: signal name '%s' is invalid for type id '%"G_GSIZE_FORMAT"'",
+ G_STRLOC, signal_name, instance_type);
}
@@ -2184,10 +2184,10 @@ g_signal_chain_from_overridden (const GValue *instance_and_params,
}
}
else
- g_warning ("%s: signal id '%u' cannot be chained from current emission stage for instance '%p'",
G_STRLOC, node->signal_id, instance);
+ g_critical ("%s: signal id '%u' cannot be chained from current emission stage for instance '%p'",
G_STRLOC, node->signal_id, instance);
}
else
- g_warning ("%s: no signal is currently being emitted for instance '%p'", G_STRLOC, instance);
+ g_critical ("%s: no signal is currently being emitted for instance '%p'", G_STRLOC, instance);
if (closure)
{
@@ -2257,10 +2257,10 @@ g_signal_chain_from_overridden_handler (gpointer instance,
}
}
else
- g_warning ("%s: signal id '%u' cannot be chained from current emission stage for instance '%p'",
G_STRLOC, node->signal_id, instance);
+ g_critical ("%s: signal id '%u' cannot be chained from current emission stage for instance '%p'",
G_STRLOC, node->signal_id, instance);
}
else
- g_warning ("%s: no signal is currently being emitted for instance '%p'", G_STRLOC, instance);
+ g_critical ("%s: no signal is currently being emitted for instance '%p'", G_STRLOC, instance);
if (closure)
{
@@ -2289,7 +2289,7 @@ g_signal_chain_from_overridden_handler (gpointer instance,
&error);
if (error)
{
- g_warning ("%s: %s", G_STRLOC, error);
+ g_critical ("%s: %s", G_STRLOC, error);
g_free (error);
/* we purposely leak the value here, it might not be
@@ -2345,7 +2345,7 @@ g_signal_chain_from_overridden_handler (gpointer instance,
}
else
{
- g_warning ("%s: %s", G_STRLOC, error);
+ g_critical ("%s: %s", G_STRLOC, error);
g_free (error);
/* we purposely leak the value here, it might not be
@@ -2421,9 +2421,9 @@ g_signal_connect_closure_by_id (gpointer instance,
if (node)
{
if (detail && !(node->flags & G_SIGNAL_DETAILED))
- g_warning ("%s: signal id '%u' does not support detail (%u)", G_STRLOC, signal_id, detail);
+ g_critical ("%s: signal id '%u' does not support detail (%u)", G_STRLOC, signal_id, detail);
else if (!g_type_is_a (G_TYPE_FROM_INSTANCE (instance), node->itype))
- g_warning ("%s: signal id '%u' is invalid for instance '%p'", G_STRLOC, signal_id, instance);
+ g_critical ("%s: signal id '%u' is invalid for instance '%p'", G_STRLOC, signal_id, instance);
else
{
Handler *handler = handler_new (signal_id, instance, after);
@@ -2446,7 +2446,7 @@ g_signal_connect_closure_by_id (gpointer instance,
}
}
else
- g_warning ("%s: signal id '%u' is invalid for instance '%p'", G_STRLOC, signal_id, instance);
+ g_critical ("%s: signal id '%u' is invalid for instance '%p'", G_STRLOC, signal_id, instance);
SIGNAL_UNLOCK ();
return handler_seq_no;
@@ -2487,10 +2487,10 @@ g_signal_connect_closure (gpointer instance,
SignalNode *node = LOOKUP_SIGNAL_NODE (signal_id);
if (detail && !(node->flags & G_SIGNAL_DETAILED))
- g_warning ("%s: signal '%s' does not support details", G_STRLOC, detailed_signal);
+ g_critical ("%s: signal '%s' does not support details", G_STRLOC, detailed_signal);
else if (!g_type_is_a (itype, node->itype))
- g_warning ("%s: signal '%s' is invalid for instance '%p' of type '%s'",
- G_STRLOC, detailed_signal, instance, g_type_name (itype));
+ g_critical ("%s: signal '%s' is invalid for instance '%p' of type '%s'",
+ G_STRLOC, detailed_signal, instance, g_type_name (itype));
else
{
Handler *handler = handler_new (signal_id, instance, after);
@@ -2513,8 +2513,8 @@ g_signal_connect_closure (gpointer instance,
}
}
else
- g_warning ("%s: signal '%s' is invalid for instance '%p' of type '%s'",
- G_STRLOC, detailed_signal, instance, g_type_name (itype));
+ g_critical ("%s: signal '%s' is invalid for instance '%p' of type '%s'",
+ G_STRLOC, detailed_signal, instance, g_type_name (itype));
SIGNAL_UNLOCK ();
return handler_seq_no;
@@ -2591,10 +2591,10 @@ g_signal_connect_data (gpointer instance,
node_check_deprecated (node);
if (detail && !(node->flags & G_SIGNAL_DETAILED))
- g_warning ("%s: signal '%s' does not support details", G_STRLOC, detailed_signal);
+ g_critical ("%s: signal '%s' does not support details", G_STRLOC, detailed_signal);
else if (!g_type_is_a (itype, node->itype))
- g_warning ("%s: signal '%s' is invalid for instance '%p' of type '%s'",
- G_STRLOC, detailed_signal, instance, g_type_name (itype));
+ g_critical ("%s: signal '%s' is invalid for instance '%p' of type '%s'",
+ G_STRLOC, detailed_signal, instance, g_type_name (itype));
else
{
Handler *handler = handler_new (signal_id, instance, after);
@@ -2616,8 +2616,8 @@ g_signal_connect_data (gpointer instance,
}
}
else
- g_warning ("%s: signal '%s' is invalid for instance '%p' of type '%s'",
- G_STRLOC, detailed_signal, instance, g_type_name (itype));
+ g_critical ("%s: signal '%s' is invalid for instance '%p' of type '%s'",
+ G_STRLOC, detailed_signal, instance, g_type_name (itype));
SIGNAL_UNLOCK ();
return handler_seq_no;
@@ -2669,7 +2669,7 @@ signal_handler_block_unlocked (gpointer instance,
handler->block_count += 1;
}
else
- g_warning ("%s: instance '%p' has no handler with id '%lu'", G_STRLOC, instance, handler_id);
+ g_critical ("%s: instance '%p' has no handler with id '%lu'", G_STRLOC, instance, handler_id);
}
static void
@@ -2719,10 +2719,10 @@ signal_handler_unblock_unlocked (gpointer instance,
if (handler->block_count)
handler->block_count -= 1;
else
- g_warning (G_STRLOC ": handler '%lu' of instance '%p' is not blocked", handler_id, instance);
+ g_critical (G_STRLOC ": handler '%lu' of instance '%p' is not blocked", handler_id, instance);
}
else
- g_warning ("%s: instance '%p' has no handler with id '%lu'", G_STRLOC, instance, handler_id);
+ g_critical ("%s: instance '%p' has no handler with id '%lu'", G_STRLOC, instance, handler_id);
}
static void
@@ -2769,7 +2769,7 @@ signal_handler_disconnect_unlocked (gpointer instance,
handler_unref_R (handler->signal_id, instance, handler);
}
else
- g_warning ("%s: instance '%p' has no handler with id '%lu'", G_STRLOC, instance, handler_id);
+ g_critical ("%s: instance '%p' has no handler with id '%lu'", G_STRLOC, instance, handler_id);
}
/**
@@ -3121,7 +3121,7 @@ g_signal_has_handler_pending (gpointer instance,
{
if (!(node->flags & G_SIGNAL_DETAILED))
{
- g_warning ("%s: signal id '%u' does not support detail (%u)", G_STRLOC, signal_id, detail);
+ g_critical ("%s: signal id '%u' does not support detail (%u)", G_STRLOC, signal_id, detail);
SIGNAL_UNLOCK ();
return FALSE;
}
@@ -3190,14 +3190,14 @@ g_signal_emitv (const GValue *instance_and_params,
node = LOOKUP_SIGNAL_NODE (signal_id);
if (!node || !g_type_is_a (G_TYPE_FROM_INSTANCE (instance), node->itype))
{
- g_warning ("%s: signal id '%u' is invalid for instance '%p'", G_STRLOC, signal_id, instance);
+ g_critical ("%s: signal id '%u' is invalid for instance '%p'", G_STRLOC, signal_id, instance);
SIGNAL_UNLOCK ();
return;
}
#ifdef G_ENABLE_DEBUG
if (detail && !(node->flags & G_SIGNAL_DETAILED))
{
- g_warning ("%s: signal id '%u' does not support detail (%u)", G_STRLOC, signal_id, detail);
+ g_critical ("%s: signal id '%u' does not support detail (%u)", G_STRLOC, signal_id, detail);
SIGNAL_UNLOCK ();
return;
}
@@ -3322,14 +3322,14 @@ g_signal_emit_valist (gpointer instance,
node = LOOKUP_SIGNAL_NODE (signal_id);
if (!node || !g_type_is_a (G_TYPE_FROM_INSTANCE (instance), node->itype))
{
- g_warning ("%s: signal id '%u' is invalid for instance '%p'", G_STRLOC, signal_id, instance);
+ g_critical ("%s: signal id '%u' is invalid for instance '%p'", G_STRLOC, signal_id, instance);
SIGNAL_UNLOCK ();
return;
}
#ifndef G_DISABLE_CHECKS
if (detail && !(node->flags & G_SIGNAL_DETAILED))
{
- g_warning ("%s: signal id '%u' does not support detail (%u)", G_STRLOC, signal_id, detail);
+ g_critical ("%s: signal id '%u' does not support detail (%u)", G_STRLOC, signal_id, detail);
SIGNAL_UNLOCK ();
return;
}
@@ -3492,7 +3492,7 @@ g_signal_emit_valist (gpointer instance,
g_value_unset (&emission_return);
else
{
- g_warning ("%s: %s", G_STRLOC, error);
+ g_critical ("%s: %s", G_STRLOC, error);
g_free (error);
/* we purposely leak the value here, it might not be
* in a correct state if an error condition occurred
@@ -3530,7 +3530,7 @@ g_signal_emit_valist (gpointer instance,
&error);
if (error)
{
- g_warning ("%s: %s", G_STRLOC, error);
+ g_critical ("%s: %s", G_STRLOC, error);
g_free (error);
/* we purposely leak the value here, it might not be
@@ -3566,7 +3566,7 @@ g_signal_emit_valist (gpointer instance,
g_value_unset (&return_value);
else
{
- g_warning ("%s: %s", G_STRLOC, error);
+ g_critical ("%s: %s", G_STRLOC, error);
g_free (error);
/* we purposely leak the value here, it might not be
@@ -3649,8 +3649,8 @@ g_signal_emit_by_name (gpointer instance,
va_end (var_args);
}
else
- g_warning ("%s: signal name '%s' is invalid for instance '%p' of type '%s'",
- G_STRLOC, detailed_signal, instance, g_type_name (itype));
+ g_critical ("%s: signal name '%s' is invalid for instance '%p' of type '%s'",
+ G_STRLOC, detailed_signal, instance, g_type_name (itype));
}
static gboolean
diff --git a/gobject/gtype.c b/gobject/gtype.c
index 177e446918..40953843db 100644
--- a/gobject/gtype.c
+++ b/gobject/gtype.c
@@ -715,26 +715,26 @@ check_plugin_U (GTypePlugin *plugin,
*/
if (!plugin)
{
- g_warning ("plugin handle for type '%s' is NULL",
- type_name);
+ g_critical ("plugin handle for type '%s' is NULL",
+ type_name);
return FALSE;
}
if (!G_IS_TYPE_PLUGIN (plugin))
{
- g_warning ("plugin pointer (%p) for type '%s' is invalid",
- plugin, type_name);
+ g_critical ("plugin pointer (%p) for type '%s' is invalid",
+ plugin, type_name);
return FALSE;
}
if (need_complete_type_info && !G_TYPE_PLUGIN_GET_CLASS (plugin)->complete_type_info)
{
- g_warning ("plugin for type '%s' has no complete_type_info() implementation",
- type_name);
+ g_critical ("plugin for type '%s' has no complete_type_info() implementation",
+ type_name);
return FALSE;
}
if (need_complete_interface_info && !G_TYPE_PLUGIN_GET_CLASS (plugin)->complete_interface_info)
{
- g_warning ("plugin for type '%s' has no complete_interface_info() implementation",
- type_name);
+ g_critical ("plugin for type '%s' has no complete_interface_info() implementation",
+ type_name);
return FALSE;
}
return TRUE;
@@ -749,7 +749,7 @@ check_type_name_I (const gchar *type_name)
if (!type_name[0] || !type_name[1] || !type_name[2])
{
- g_warning ("type name '%s' is too short", type_name);
+ g_critical ("type name '%s' is too short", type_name);
return FALSE;
}
/* check the first letter */
@@ -761,12 +761,12 @@ check_type_name_I (const gchar *type_name)
strchr (extra_chars, p[0]));
if (!name_valid)
{
- g_warning ("type name '%s' contains invalid characters", type_name);
+ g_critical ("type name '%s' contains invalid characters", type_name);
return FALSE;
}
if (g_type_from_name (type_name))
{
- g_warning ("cannot register existing type '%s'", type_name);
+ g_critical ("cannot register existing type '%s'", type_name);
return FALSE;
}
@@ -783,34 +783,34 @@ check_derivation_I (GType parent_type,
pnode = lookup_type_node_I (parent_type);
if (!pnode)
{
- g_warning ("cannot derive type '%s' from invalid parent type '%s'",
- type_name,
- type_descriptive_name_I (parent_type));
+ g_critical ("cannot derive type '%s' from invalid parent type '%s'",
+ type_name,
+ type_descriptive_name_I (parent_type));
return FALSE;
}
finfo = type_node_fundamental_info_I (pnode);
/* ensure flat derivability */
if (!(finfo->type_flags & G_TYPE_FLAG_DERIVABLE))
{
- g_warning ("cannot derive '%s' from non-derivable parent type '%s'",
- type_name,
- NODE_NAME (pnode));
+ g_critical ("cannot derive '%s' from non-derivable parent type '%s'",
+ type_name,
+ NODE_NAME (pnode));
return FALSE;
}
/* ensure deep derivability */
if (parent_type != NODE_FUNDAMENTAL_TYPE (pnode) &&
!(finfo->type_flags & G_TYPE_FLAG_DEEP_DERIVABLE))
{
- g_warning ("cannot derive '%s' from non-fundamental parent type '%s'",
- type_name,
- NODE_NAME (pnode));
+ g_critical ("cannot derive '%s' from non-fundamental parent type '%s'",
+ type_name,
+ NODE_NAME (pnode));
return FALSE;
}
if ((G_TYPE_FLAG_FINAL & GPOINTER_TO_UINT (type_get_qdata_L (pnode, static_quark_type_flags))) ==
G_TYPE_FLAG_FINAL)
{
- g_warning ("cannot derive '%s' from final parent type '%s'",
- type_name,
- NODE_NAME (pnode));
+ g_critical ("cannot derive '%s' from final parent type '%s'",
+ type_name,
+ NODE_NAME (pnode));
return FALSE;
}
@@ -843,8 +843,8 @@ check_value_table_I (const gchar *type_name,
value_table->value_peek_pointer ||
value_table->collect_format || value_table->collect_value ||
value_table->lcopy_format || value_table->lcopy_value)
- g_warning ("cannot handle uninitializable values of type '%s'",
- type_name);
+ g_critical ("cannot handle uninitializable values of type '%s'",
+ type_name);
return FALSE;
}
else /* value_table->value_init != NULL */
@@ -852,41 +852,41 @@ check_value_table_I (const gchar *type_name,
if (!value_table->value_free)
{
/* +++ optional +++
- * g_warning ("missing 'value_free()' for type '%s'", type_name);
+ * g_critical ("missing 'value_free()' for type '%s'", type_name);
* return FALSE;
*/
}
if (!value_table->value_copy)
{
- g_warning ("missing 'value_copy()' for type '%s'", type_name);
+ g_critical ("missing 'value_copy()' for type '%s'", type_name);
return FALSE;
}
if ((value_table->collect_format || value_table->collect_value) &&
(!value_table->collect_format || !value_table->collect_value))
{
- g_warning ("one of 'collect_format' and 'collect_value()' is unspecified for type '%s'",
- type_name);
+ g_critical ("one of 'collect_format' and 'collect_value()' is unspecified for type '%s'",
+ type_name);
return FALSE;
}
if (value_table->collect_format && !check_collect_format_I (value_table->collect_format))
{
- g_warning ("the '%s' specification for type '%s' is too long or invalid",
- "collect_format",
- type_name);
+ g_critical ("the '%s' specification for type '%s' is too long or invalid",
+ "collect_format",
+ type_name);
return FALSE;
}
if ((value_table->lcopy_format || value_table->lcopy_value) &&
(!value_table->lcopy_format || !value_table->lcopy_value))
{
- g_warning ("one of 'lcopy_format' and 'lcopy_value()' is unspecified for type '%s'",
- type_name);
+ g_critical ("one of 'lcopy_format' and 'lcopy_value()' is unspecified for type '%s'",
+ type_name);
return FALSE;
}
if (value_table->lcopy_format && !check_collect_format_I (value_table->lcopy_format))
{
- g_warning ("the '%s' specification for type '%s' is too long or invalid",
- "lcopy_format",
- type_name);
+ g_critical ("the '%s' specification for type '%s' is too long or invalid",
+ "lcopy_format",
+ type_name);
return FALSE;
}
}
@@ -909,12 +909,12 @@ check_type_info_I (TypeNode *pnode,
(info->instance_size || info->n_preallocs || info->instance_init))
{
if (pnode)
- g_warning ("cannot instantiate '%s', derived from non-instantiatable parent type '%s'",
- type_name,
- NODE_NAME (pnode));
+ g_critical ("cannot instantiate '%s', derived from non-instantiatable parent type '%s'",
+ type_name,
+ NODE_NAME (pnode));
else
- g_warning ("cannot instantiate '%s' as non-instantiatable fundamental",
- type_name);
+ g_critical ("cannot instantiate '%s' as non-instantiatable fundamental",
+ type_name);
return FALSE;
}
/* check class & interface members */
@@ -923,19 +923,19 @@ check_type_info_I (TypeNode *pnode,
info->class_size || info->base_init || info->base_finalize))
{
if (pnode)
- g_warning ("cannot create class for '%s', derived from non-classed parent type '%s'",
- type_name,
- NODE_NAME (pnode));
+ g_critical ("cannot create class for '%s', derived from non-classed parent type '%s'",
+ type_name,
+ NODE_NAME (pnode));
else
- g_warning ("cannot create class for '%s' as non-classed fundamental",
- type_name);
+ g_critical ("cannot create class for '%s' as non-classed fundamental",
+ type_name);
return FALSE;
}
/* check interface size */
if (is_interface && info->class_size < sizeof (GTypeInterface))
{
- g_warning ("specified interface size for type '%s' is smaller than 'GTypeInterface' size",
- type_name);
+ g_critical ("specified interface size for type '%s' is smaller than 'GTypeInterface' size",
+ type_name);
return FALSE;
}
/* check class size */
@@ -943,16 +943,16 @@ check_type_info_I (TypeNode *pnode,
{
if (info->class_size < sizeof (GTypeClass))
{
- g_warning ("specified class size for type '%s' is smaller than 'GTypeClass' size",
- type_name);
+ g_critical ("specified class size for type '%s' is smaller than 'GTypeClass' size",
+ type_name);
return FALSE;
}
if (pnode && info->class_size < pnode->data->class.class_size)
{
- g_warning ("specified class size for type '%s' is smaller "
- "than the parent type's '%s' class size",
- type_name,
- NODE_NAME (pnode));
+ g_critical ("specified class size for type '%s' is smaller "
+ "than the parent type's '%s' class size",
+ type_name,
+ NODE_NAME (pnode));
return FALSE;
}
}
@@ -961,16 +961,16 @@ check_type_info_I (TypeNode *pnode,
{
if (info->instance_size < sizeof (GTypeInstance))
{
- g_warning ("specified instance size for type '%s' is smaller than 'GTypeInstance' size",
- type_name);
+ g_critical ("specified instance size for type '%s' is smaller than 'GTypeInstance' size",
+ type_name);
return FALSE;
}
if (pnode && info->instance_size < pnode->data->instance.instance_size)
{
- g_warning ("specified instance size for type '%s' is smaller "
- "than the parent type's '%s' instance size",
- type_name,
- NODE_NAME (pnode));
+ g_critical ("specified instance size for type '%s' is smaller "
+ "than the parent type's '%s' instance size",
+ type_name,
+ NODE_NAME (pnode));
return FALSE;
}
}
@@ -1008,31 +1008,31 @@ check_add_interface_L (GType instance_type,
if (!node || !node->is_instantiatable)
{
- g_warning ("cannot add interfaces to invalid (non-instantiatable) type '%s'",
- type_descriptive_name_I (instance_type));
+ g_critical ("cannot add interfaces to invalid (non-instantiatable) type '%s'",
+ type_descriptive_name_I (instance_type));
return FALSE;
}
if (!iface || !NODE_IS_IFACE (iface))
{
- g_warning ("cannot add invalid (non-interface) type '%s' to type '%s'",
- type_descriptive_name_I (iface_type),
- NODE_NAME (node));
+ g_critical ("cannot add invalid (non-interface) type '%s' to type '%s'",
+ type_descriptive_name_I (iface_type),
+ NODE_NAME (node));
return FALSE;
}
if (node->data && node->data->class.class)
{
- g_warning ("attempting to add an interface (%s) to class (%s) after class_init",
- NODE_NAME (iface), NODE_NAME (node));
+ g_critical ("attempting to add an interface (%s) to class (%s) after class_init",
+ NODE_NAME (iface), NODE_NAME (node));
return FALSE;
}
tnode = lookup_type_node_I (NODE_PARENT_TYPE (iface));
if (NODE_PARENT_TYPE (tnode) && !type_lookup_iface_entry_L (node, tnode))
{
/* 2001/7/31:timj: erk, i guess this warning is junk as interface derivation is flat */
- g_warning ("cannot add sub-interface '%s' to type '%s' which does not conform to super-interface '%s'",
- NODE_NAME (iface),
- NODE_NAME (node),
- NODE_NAME (tnode));
+ g_critical ("cannot add sub-interface '%s' to type '%s' which does not conform to super-interface
'%s'",
+ NODE_NAME (iface),
+ NODE_NAME (node),
+ NODE_NAME (tnode));
return FALSE;
}
/* allow overriding of interface type introduced for parent type */
@@ -1051,10 +1051,10 @@ check_add_interface_L (GType instance_type,
tnode = find_conforming_child_type_L (node, iface); /* tnode is_a node */
if (tnode)
{
- g_warning ("cannot add interface type '%s' to type '%s', since type '%s' already conforms to
interface",
- NODE_NAME (iface),
- NODE_NAME (node),
- NODE_NAME (tnode));
+ g_critical ("cannot add interface type '%s' to type '%s', since type '%s' already conforms to
interface",
+ NODE_NAME (iface),
+ NODE_NAME (node),
+ NODE_NAME (tnode));
return FALSE;
}
prerequisites = IFACE_NODE_PREREQUISITES (iface);
@@ -1063,10 +1063,10 @@ check_add_interface_L (GType instance_type,
tnode = lookup_type_node_I (prerequisites[i]);
if (!type_node_is_a_L (node, tnode))
{
- g_warning ("cannot add interface type '%s' to type '%s' which does not conform to prerequisite
'%s'",
- NODE_NAME (iface),
- NODE_NAME (node),
- NODE_NAME (tnode));
+ g_critical ("cannot add interface type '%s' to type '%s' which does not conform to prerequisite
'%s'",
+ NODE_NAME (iface),
+ NODE_NAME (node),
+ NODE_NAME (tnode));
return FALSE;
}
}
@@ -1080,9 +1080,9 @@ check_interface_info_I (TypeNode *iface,
{
if ((info->interface_finalize || info->interface_data) && !info->interface_init)
{
- g_warning ("interface type '%s' for type '%s' comes without initializer",
- NODE_NAME (iface),
- type_descriptive_name_I (instance_type));
+ g_critical ("interface type '%s' for type '%s' comes without initializer",
+ NODE_NAME (iface),
+ type_descriptive_name_I (instance_type));
return FALSE;
}
@@ -1584,9 +1584,9 @@ g_type_interface_add_prerequisite (GType interface_type,
prerequisite_node = lookup_type_node_I (prerequisite_type);
if (!iface || !prerequisite_node || !NODE_IS_IFACE (iface))
{
- g_warning ("interface type '%s' or prerequisite type '%s' invalid",
- type_descriptive_name_I (interface_type),
- type_descriptive_name_I (prerequisite_type));
+ g_critical ("interface type '%s' or prerequisite type '%s' invalid",
+ type_descriptive_name_I (interface_type),
+ type_descriptive_name_I (prerequisite_type));
return;
}
G_WRITE_LOCK (&type_rw_lock);
@@ -1594,10 +1594,10 @@ g_type_interface_add_prerequisite (GType interface_type,
if (holders)
{
G_WRITE_UNLOCK (&type_rw_lock);
- g_warning ("unable to add prerequisite '%s' to interface '%s' which is already in use for '%s'",
- type_descriptive_name_I (prerequisite_type),
- type_descriptive_name_I (interface_type),
- type_descriptive_name_I (holders->instance_type));
+ g_critical ("unable to add prerequisite '%s' to interface '%s' which is already in use for '%s'",
+ type_descriptive_name_I (prerequisite_type),
+ type_descriptive_name_I (interface_type),
+ type_descriptive_name_I (holders->instance_type));
return;
}
if (prerequisite_node->is_instantiatable)
@@ -1612,10 +1612,10 @@ g_type_interface_add_prerequisite (GType interface_type,
if (prnode->is_instantiatable)
{
G_WRITE_UNLOCK (&type_rw_lock);
- g_warning ("adding prerequisite '%s' to interface '%s' conflicts with existing prerequisite
'%s'",
- type_descriptive_name_I (prerequisite_type),
- type_descriptive_name_I (interface_type),
- type_descriptive_name_I (NODE_TYPE (prnode)));
+ g_critical ("adding prerequisite '%s' to interface '%s' conflicts with existing prerequisite
'%s'",
+ type_descriptive_name_I (prerequisite_type),
+ type_descriptive_name_I (interface_type),
+ type_descriptive_name_I (NODE_TYPE (prnode)));
return;
}
}
@@ -1638,9 +1638,9 @@ g_type_interface_add_prerequisite (GType interface_type,
else
{
G_WRITE_UNLOCK (&type_rw_lock);
- g_warning ("prerequisite '%s' for interface '%s' is neither instantiatable nor interface",
- type_descriptive_name_I (prerequisite_type),
- type_descriptive_name_I (interface_type));
+ g_critical ("prerequisite '%s' for interface '%s' is neither instantiatable nor interface",
+ type_descriptive_name_I (prerequisite_type),
+ type_descriptive_name_I (interface_type));
}
}
@@ -1967,15 +1967,15 @@ g_type_free_instance (GTypeInstance *instance)
node = lookup_type_node_I (class->g_type);
if (G_UNLIKELY (!node || !node->is_instantiatable || !node->data || node->data->class.class != (gpointer)
class))
{
- g_warning ("cannot free instance of invalid (non-instantiatable) type '%s'",
- type_descriptive_name_I (class->g_type));
+ g_critical ("cannot free instance of invalid (non-instantiatable) type '%s'",
+ type_descriptive_name_I (class->g_type));
return;
}
/* G_TYPE_IS_ABSTRACT() is an external call: _U */
if (G_UNLIKELY (!node->mutatable_check_cache && G_TYPE_IS_ABSTRACT (NODE_TYPE (node))))
{
- g_warning ("cannot free instance of abstract (non-instantiatable) type '%s'",
- NODE_NAME (node));
+ g_critical ("cannot free instance of abstract (non-instantiatable) type '%s'",
+ NODE_NAME (node));
return;
}
@@ -2397,8 +2397,8 @@ type_data_last_unref_Wm (TypeNode *node,
if (!node->data || NODE_REFCOUNT (node) == 0)
{
- g_warning ("cannot drop last reference to unreferenced type '%s'",
- NODE_NAME (node));
+ g_critical ("cannot drop last reference to unreferenced type '%s'",
+ NODE_NAME (node));
return;
}
@@ -2496,8 +2496,8 @@ type_data_unref_U (TypeNode *node,
{
if (!node->plugin)
{
- g_warning ("static type '%s' unreferenced too often",
- NODE_NAME (node));
+ g_critical ("static type '%s' unreferenced too often",
+ NODE_NAME (node));
return;
}
else
@@ -2584,8 +2584,8 @@ g_type_remove_class_cache_func (gpointer cache_data,
G_WRITE_UNLOCK (&type_rw_lock);
if (!found_it)
- g_warning (G_STRLOC ": cannot remove unregistered class cache func %p with data %p",
- cache_func, cache_data);
+ g_critical (G_STRLOC ": cannot remove unregistered class cache func %p with data %p",
+ cache_func, cache_data);
}
@@ -2658,8 +2658,8 @@ g_type_remove_interface_check (gpointer check_data,
G_WRITE_UNLOCK (&type_rw_lock);
if (!found_it)
- g_warning (G_STRLOC ": cannot remove unregistered class check func %p with data %p",
- check_func, check_data);
+ g_critical (G_STRLOC ": cannot remove unregistered class check func %p with data %p",
+ check_func, check_data);
}
/* --- type registration --- */
@@ -2701,23 +2701,23 @@ g_type_register_fundamental (GType type_id,
if ((type_id & TYPE_ID_MASK) ||
type_id > G_TYPE_FUNDAMENTAL_MAX)
{
- g_warning ("attempt to register fundamental type '%s' with invalid type id (%" G_GSIZE_FORMAT ")",
- type_name,
- type_id);
+ g_critical ("attempt to register fundamental type '%s' with invalid type id (%" G_GSIZE_FORMAT ")",
+ type_name,
+ type_id);
return 0;
}
if ((finfo->type_flags & G_TYPE_FLAG_INSTANTIATABLE) &&
!(finfo->type_flags & G_TYPE_FLAG_CLASSED))
{
- g_warning ("cannot register instantiatable fundamental type '%s' as non-classed",
- type_name);
+ g_critical ("cannot register instantiatable fundamental type '%s' as non-classed",
+ type_name);
return 0;
}
if (lookup_type_node_I (type_id))
{
- g_warning ("cannot register existing fundamental type '%s' (as '%s')",
- type_descriptive_name_I (type_id),
- type_name);
+ g_critical ("cannot register existing fundamental type '%s' (as '%s')",
+ type_descriptive_name_I (type_id),
+ type_name);
return 0;
}
@@ -2817,8 +2817,8 @@ g_type_register_static (GType parent_type,
return 0;
if (info->class_finalize)
{
- g_warning ("class finalizer specified for static type '%s'",
- type_name);
+ g_critical ("class finalizer specified for static type '%s'",
+ type_name);
return 0;
}
@@ -2980,8 +2980,8 @@ g_type_class_ref (GType type)
node = lookup_type_node_I (type);
if (!node || !node->is_classed)
{
- g_warning ("cannot retrieve class for invalid (unclassed) type '%s'",
- type_descriptive_name_I (type));
+ g_critical ("cannot retrieve class for invalid (unclassed) type '%s'",
+ type_descriptive_name_I (type));
return NULL;
}
@@ -3044,8 +3044,8 @@ g_type_class_unref (gpointer g_class)
if (node && node->is_classed && NODE_REFCOUNT (node))
type_data_unref_U (node, FALSE);
else
- g_warning ("cannot unreference class of invalid (unclassed) type '%s'",
- type_descriptive_name_I (class->g_type));
+ g_critical ("cannot unreference class of invalid (unclassed) type '%s'",
+ type_descriptive_name_I (class->g_type));
}
/**
@@ -3069,8 +3069,8 @@ g_type_class_unref_uncached (gpointer g_class)
if (node && node->is_classed && NODE_REFCOUNT (node))
type_data_unref_U (node, TRUE);
else
- g_warning ("cannot unreference class of invalid (unclassed) type '%s'",
- type_descriptive_name_I (class->g_type));
+ g_critical ("cannot unreference class of invalid (unclassed) type '%s'",
+ type_descriptive_name_I (class->g_type));
}
/**
@@ -3174,7 +3174,7 @@ g_type_class_peek_parent (gpointer g_class)
class = node->data->class.class;
}
else if (NODE_PARENT_TYPE (node))
- g_warning (G_STRLOC ": invalid class pointer '%p'", g_class);
+ g_critical (G_STRLOC ": invalid class pointer '%p'", g_class);
return class;
}
@@ -3207,7 +3207,7 @@ g_type_interface_peek (gpointer instance_class,
if (node && node->is_instantiatable && iface)
type_lookup_iface_vtable_I (node, iface, &vtable);
else
- g_warning (G_STRLOC ": invalid class pointer '%p'", class);
+ g_critical (G_STRLOC ": invalid class pointer '%p'", class);
return vtable;
}
@@ -3243,7 +3243,7 @@ g_type_interface_peek_parent (gpointer g_iface)
if (node && node->is_instantiatable && iface)
type_lookup_iface_vtable_I (node, iface, &vtable);
else if (node)
- g_warning (G_STRLOC ": invalid interface pointer '%p'", g_iface);
+ g_critical (G_STRLOC ": invalid interface pointer '%p'", g_iface);
return vtable;
}
@@ -3282,8 +3282,8 @@ g_type_default_interface_ref (GType g_type)
(node->data && NODE_REFCOUNT (node) == 0))
{
G_WRITE_UNLOCK (&type_rw_lock);
- g_warning ("cannot retrieve default vtable for invalid or non-interface type '%s'",
- type_descriptive_name_I (g_type));
+ g_critical ("cannot retrieve default vtable for invalid or non-interface type '%s'",
+ type_descriptive_name_I (g_type));
return NULL;
}
@@ -3359,8 +3359,8 @@ g_type_default_interface_unref (gpointer g_iface)
if (node && NODE_IS_IFACE (node))
type_data_unref_U (node, FALSE);
else
- g_warning ("cannot unreference invalid interface default vtable for '%s'",
- type_descriptive_name_I (vtable->g_type));
+ g_critical ("cannot unreference invalid interface default vtable for '%s'",
+ type_descriptive_name_I (vtable->g_type));
}
/**
@@ -3848,7 +3848,7 @@ type_add_flags_W (TypeNode *node,
g_return_if_fail (node != NULL);
if ((flags & TYPE_FLAG_MASK) && node->is_classed && node->data && node->data->class.class)
- g_warning ("tagging type '%s' as abstract after class initialization", NODE_NAME (node));
+ g_critical ("tagging type '%s' as abstract after class initialization", NODE_NAME (node));
dflags = GPOINTER_TO_UINT (type_get_qdata_L (node, static_quark_type_flags));
dflags |= flags;
type_set_qdata_W (node, static_quark_type_flags, GUINT_TO_POINTER (dflags));
@@ -4023,7 +4023,7 @@ g_type_interface_get_plugin (GType instance_type,
g_return_val_if_fail (node == NULL, NULL);
g_return_val_if_fail (iface == NULL, NULL);
- g_warning (G_STRLOC ": attempt to look up plugin for invalid instance/interface type pair.");
+ g_critical (G_STRLOC ": attempt to look up plugin for invalid instance/interface type pair.");
return NULL;
}
@@ -4132,17 +4132,17 @@ g_type_check_instance_cast (GTypeInstance *type_instance,
return type_instance;
if (is_instantiatable)
- g_warning ("invalid cast from '%s' to '%s'",
- type_descriptive_name_I (type_instance->g_class->g_type),
- type_descriptive_name_I (iface_type));
+ g_critical ("invalid cast from '%s' to '%s'",
+ type_descriptive_name_I (type_instance->g_class->g_type),
+ type_descriptive_name_I (iface_type));
else
- g_warning ("invalid uninstantiatable type '%s' in cast to '%s'",
- type_descriptive_name_I (type_instance->g_class->g_type),
- type_descriptive_name_I (iface_type));
+ g_critical ("invalid uninstantiatable type '%s' in cast to '%s'",
+ type_descriptive_name_I (type_instance->g_class->g_type),
+ type_descriptive_name_I (iface_type));
}
else
- g_warning ("invalid unclassed pointer in cast to '%s'",
- type_descriptive_name_I (iface_type));
+ g_critical ("invalid unclassed pointer in cast to '%s'",
+ type_descriptive_name_I (iface_type));
}
return type_instance;
@@ -4165,17 +4165,17 @@ g_type_check_class_cast (GTypeClass *type_class,
return type_class;
if (is_classed)
- g_warning ("invalid class cast from '%s' to '%s'",
- type_descriptive_name_I (type_class->g_type),
- type_descriptive_name_I (is_a_type));
+ g_critical ("invalid class cast from '%s' to '%s'",
+ type_descriptive_name_I (type_class->g_type),
+ type_descriptive_name_I (is_a_type));
else
- g_warning ("invalid unclassed type '%s' in class cast to '%s'",
- type_descriptive_name_I (type_class->g_type),
- type_descriptive_name_I (is_a_type));
+ g_critical ("invalid unclassed type '%s' in class cast to '%s'",
+ type_descriptive_name_I (type_class->g_type),
+ type_descriptive_name_I (is_a_type));
}
else
- g_warning ("invalid class cast from (NULL) pointer to '%s'",
- type_descriptive_name_I (is_a_type));
+ g_critical ("invalid class cast from (NULL) pointer to '%s'",
+ type_descriptive_name_I (is_a_type));
return type_class;
}
@@ -4203,14 +4203,14 @@ g_type_check_instance (GTypeInstance *type_instance)
if (node && node->is_instantiatable)
return TRUE;
- g_warning ("instance of invalid non-instantiatable type '%s'",
- type_descriptive_name_I (type_instance->g_class->g_type));
+ g_critical ("instance of invalid non-instantiatable type '%s'",
+ type_descriptive_name_I (type_instance->g_class->g_type));
}
else
- g_warning ("instance with invalid (NULL) class pointer");
+ g_critical ("instance with invalid (NULL) class pointer");
}
else
- g_warning ("invalid (NULL) pointer instance");
+ g_critical ("invalid (NULL) pointer instance");
return FALSE;
}
@@ -4332,10 +4332,10 @@ g_type_value_table_peek (GType type)
return vtable;
if (!node)
- g_warning (G_STRLOC ": type id '%" G_GSIZE_FORMAT "' is invalid", type);
+ g_critical (G_STRLOC ": type id '%" G_GSIZE_FORMAT "' is invalid", type);
if (!has_refed_data)
- g_warning ("can't peek value table for type '%s' which is not currently referenced",
- type_descriptive_name_I (type));
+ g_critical ("can't peek value table for type '%s' which is not currently referenced",
+ type_descriptive_name_I (type));
return NULL;
}
@@ -4699,8 +4699,8 @@ g_type_class_add_private (gpointer g_class,
if (!node || !node->is_instantiatable || !node->data || node->data->class.class != g_class)
{
- g_warning ("cannot add private field to invalid (non-instantiatable) type '%s'",
- type_descriptive_name_I (instance_type));
+ g_critical ("cannot add private field to invalid (non-instantiatable) type '%s'",
+ type_descriptive_name_I (instance_type));
return;
}
@@ -4709,7 +4709,7 @@ g_type_class_add_private (gpointer g_class,
TypeNode *pnode = lookup_type_node_I (NODE_PARENT_TYPE (node));
if (node->data->instance.private_size != pnode->data->instance.private_size)
{
- g_warning ("g_type_class_add_private() called multiple times for the same type");
+ g_critical ("g_type_class_add_private() called multiple times for the same type");
return;
}
}
@@ -4735,15 +4735,15 @@ g_type_add_instance_private (GType class_gtype,
if (!node || !node->is_classed || !node->is_instantiatable || !node->data)
{
- g_warning ("cannot add private field to invalid (non-instantiatable) type '%s'",
- type_descriptive_name_I (class_gtype));
+ g_critical ("cannot add private field to invalid (non-instantiatable) type '%s'",
+ type_descriptive_name_I (class_gtype));
return 0;
}
if (node->plugin != NULL)
{
- g_warning ("cannot use g_type_add_instance_private() with dynamic type '%s'",
- type_descriptive_name_I (class_gtype));
+ g_critical ("cannot use g_type_add_instance_private() with dynamic type '%s'",
+ type_descriptive_name_I (class_gtype));
return 0;
}
@@ -4802,8 +4802,8 @@ g_type_class_adjust_private_offset (gpointer g_class,
if (!node || !node->is_classed || !node->is_instantiatable || !node->data)
{
- g_warning ("cannot add private field to invalid (non-instantiatable) type '%s'",
- type_descriptive_name_I (class_gtype));
+ g_critical ("cannot add private field to invalid (non-instantiatable) type '%s'",
+ type_descriptive_name_I (class_gtype));
*private_size_or_offset = 0;
return;
}
@@ -4813,7 +4813,7 @@ g_type_class_adjust_private_offset (gpointer g_class,
TypeNode *pnode = lookup_type_node_I (NODE_PARENT_TYPE (node));
if (node->data->instance.private_size != pnode->data->instance.private_size)
{
- g_warning ("g_type_add_instance_private() called multiple times for the same type");
+ g_critical ("g_type_add_instance_private() called multiple times for the same type");
*private_size_or_offset = 0;
return;
}
@@ -4841,8 +4841,8 @@ g_type_instance_get_private (GTypeInstance *instance,
node = lookup_type_node_I (private_type);
if (G_UNLIKELY (!node || !node->is_instantiatable))
{
- g_warning ("instance of invalid non-instantiatable type '%s'",
- type_descriptive_name_I (instance->g_class->g_type));
+ g_critical ("instance of invalid non-instantiatable type '%s'",
+ type_descriptive_name_I (instance->g_class->g_type));
return NULL;
}
@@ -4926,8 +4926,8 @@ g_type_add_class_private (GType class_type,
if (!node || !node->is_classed || !node->data)
{
- g_warning ("cannot add class private field to invalid type '%s'",
- type_descriptive_name_I (class_type));
+ g_critical ("cannot add class private field to invalid type '%s'",
+ type_descriptive_name_I (class_type));
return;
}
@@ -4936,7 +4936,7 @@ g_type_add_class_private (GType class_type,
TypeNode *pnode = lookup_type_node_I (NODE_PARENT_TYPE (node));
if (node->data->class.class_private_size != pnode->data->class.class_private_size)
{
- g_warning ("g_type_add_class_private() called multiple times for the same type");
+ g_critical ("g_type_add_class_private() called multiple times for the same type");
return;
}
}
@@ -4963,16 +4963,16 @@ g_type_class_get_private (GTypeClass *klass,
class_node = lookup_type_node_I (klass->g_type);
if (G_UNLIKELY (!class_node || !class_node->is_classed))
{
- g_warning ("class of invalid type '%s'",
- type_descriptive_name_I (klass->g_type));
+ g_critical ("class of invalid type '%s'",
+ type_descriptive_name_I (klass->g_type));
return NULL;
}
private_node = lookup_type_node_I (private_type);
if (G_UNLIKELY (!private_node || !NODE_IS_ANCESTOR (private_node, class_node)))
{
- g_warning ("attempt to retrieve private data for invalid type '%s'",
- type_descriptive_name_I (private_type));
+ g_critical ("attempt to retrieve private data for invalid type '%s'",
+ type_descriptive_name_I (private_type));
return NULL;
}
@@ -4985,7 +4985,7 @@ g_type_class_get_private (GTypeClass *klass,
if (G_UNLIKELY (private_node->data->class.class_private_size ==
parent_node->data->class.class_private_size))
{
- g_warning ("g_type_instance_get_class_private() requires a prior call to
g_type_add_class_private()");
+ g_critical ("g_type_instance_get_class_private() requires a prior call to
g_type_add_class_private()");
return NULL;
}
diff --git a/gobject/gtypemodule.c b/gobject/gtypemodule.c
index a95fbbb596..ec95110902 100644
--- a/gobject/gtypemodule.c
+++ b/gobject/gtypemodule.c
@@ -101,7 +101,7 @@ g_type_module_dispose (GObject *object)
if (module->type_infos || module->interface_infos)
{
- g_warning (G_STRLOC ": unsolicitated invocation of g_object_run_dispose() on GTypeModule");
+ g_critical (G_STRLOC ": unsolicitated invocation of g_object_run_dispose() on GTypeModule");
g_object_ref (object);
}
@@ -259,9 +259,9 @@ g_type_module_use (GTypeModule *module)
ModuleTypeInfo *type_info = tmp_list->data;
if (!type_info->loaded)
{
- g_warning ("plugin '%s' failed to register type '%s'",
- module->name ? module->name : "(unknown)",
- g_type_name (type_info->type));
+ g_critical ("plugin '%s' failed to register type '%s'",
+ module->name ? module->name : "(unknown)",
+ g_type_name (type_info->type));
module->use_count--;
return FALSE;
}
@@ -315,9 +315,8 @@ g_type_module_use_plugin (GTypePlugin *plugin)
if (!g_type_module_use (module))
{
- g_warning ("Fatal error - Could not reload previously loaded plugin '%s'",
- module->name ? module->name : "(unknown)");
- exit (1);
+ g_error ("Fatal error - Could not reload previously loaded plugin '%s'",
+ module->name ? module->name : "(unknown)");
}
}
@@ -406,7 +405,7 @@ g_type_module_register_type (GTypeModule *module,
if (old_plugin != G_TYPE_PLUGIN (module))
{
- g_warning ("Two different plugins tried to register '%s'.", type_name);
+ g_critical ("Two different plugins tried to register '%s'.", type_name);
return 0;
}
}
@@ -419,10 +418,10 @@ g_type_module_register_type (GTypeModule *module,
{
const gchar *parent_type_name = g_type_name (parent_type);
- g_warning ("Type '%s' recreated with different parent type."
- "(was '%s', now '%s')", type_name,
- g_type_name (module_type_info->parent_type),
- parent_type_name ? parent_type_name : "(unknown)");
+ g_critical ("Type '%s' recreated with different parent type."
+ "(was '%s', now '%s')", type_name,
+ g_type_name (module_type_info->parent_type),
+ parent_type_name ? parent_type_name : "(unknown)");
return 0;
}
@@ -488,14 +487,14 @@ g_type_module_add_interface (GTypeModule *module,
if (!old_plugin)
{
- g_warning ("Interface '%s' for '%s' was previously registered statically or for a parent type.",
- g_type_name (interface_type), g_type_name (instance_type));
+ g_critical ("Interface '%s' for '%s' was previously registered statically or for a parent type.",
+ g_type_name (interface_type), g_type_name (instance_type));
return;
}
else if (old_plugin != G_TYPE_PLUGIN (module))
{
- g_warning ("Two different plugins tried to register interface '%s' for '%s'.",
- g_type_name (interface_type), g_type_name (instance_type));
+ g_critical ("Two different plugins tried to register interface '%s' for '%s'.",
+ g_type_name (interface_type), g_type_name (instance_type));
return;
}
diff --git a/gobject/gvalue.c b/gobject/gvalue.c
index d2da4166f4..699fc79e3c 100644
--- a/gobject/gvalue.c
+++ b/gobject/gvalue.c
@@ -211,15 +211,15 @@ g_value_init (GValue *value,
value_table->value_init (value);
}
else if (G_VALUE_TYPE (value))
- g_warning ("%s: cannot initialize GValue with type '%s', the value has already been initialized as '%s'",
- G_STRLOC,
- g_type_name (g_type),
- g_type_name (G_VALUE_TYPE (value)));
+ g_critical ("%s: cannot initialize GValue with type '%s', the value has already been initialized as
'%s'",
+ G_STRLOC,
+ g_type_name (g_type),
+ g_type_name (G_VALUE_TYPE (value)));
else /* !G_TYPE_IS_VALUE (g_type) */
- g_warning ("%s: cannot initialize GValue with type '%s', %s",
- G_STRLOC,
- g_type_name (g_type),
- value_table ? "this type is abstract with regards to GValue use, use a more specific
(derived) type" : "this type has no GTypeValueTable implementation");
+ g_critical ("%s: cannot initialize GValue with type '%s', %s",
+ G_STRLOC,
+ g_type_name (g_type),
+ value_table ? "this type is abstract with regards to GValue use, use a more specific
(derived) type" : "this type has no GTypeValueTable implementation");
return value;
}
@@ -407,7 +407,7 @@ g_value_set_instance (GValue *value,
error_msg = value_table->collect_value (value, 1, &cvalue, 0);
if (error_msg)
{
- g_warning ("%s: %s", G_STRLOC, error_msg);
+ g_critical ("%s: %s", G_STRLOC, error_msg);
g_free (error_msg);
/* we purposely leak the value here, it might not be
@@ -471,7 +471,7 @@ g_value_init_from_instance (GValue *value,
error_msg = value_table->collect_value (value, 1, &cvalue, 0);
if (error_msg)
{
- g_warning ("%s: %s", G_STRLOC, error_msg);
+ g_critical ("%s: %s", G_STRLOC, error_msg);
g_free (error_msg);
/* we purposely leak the value here, it might not be
diff --git a/gobject/tests/binding.c b/gobject/tests/binding.c
index cc6e65987c..70cf6d6cde 100644
--- a/gobject/tests/binding.c
+++ b/gobject/tests/binding.c
@@ -843,7 +843,7 @@ binding_fail (void)
G_BINDING_DEFAULT);
g_object_add_weak_pointer (G_OBJECT (binding), (gpointer *) &binding);
- g_test_expect_message ("GLib-GObject", G_LOG_LEVEL_WARNING,
+ g_test_expect_message ("GLib-GObject", G_LOG_LEVEL_CRITICAL,
"*Unable to convert*double*boolean*");
g_object_set (source, "double-value", 1.0, NULL);
g_test_assert_expected_messages ();
diff --git a/gobject/tests/properties.c b/gobject/tests/properties.c
index da467c2fee..e4ef80668d 100644
--- a/gobject/tests/properties.c
+++ b/gobject/tests/properties.c
@@ -584,7 +584,7 @@ properties_testv_with_invalid_property_type (void)
}
g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
- g_test_trap_assert_stderr ("*WARNING*foo*gint*gchararray*");
+ g_test_trap_assert_stderr ("*CRITICAL*foo*gint*gchararray*");
}
diff --git a/gobject/tests/signals.c b/gobject/tests/signals.c
index e3648cfad9..1c7085244a 100644
--- a/gobject/tests/signals.c
+++ b/gobject/tests/signals.c
@@ -1546,13 +1546,13 @@ test_signal_disconnect_wrong_object (void)
NULL);
/* disconnect from the wrong object (same type), should warn */
- g_test_expect_message ("GLib-GObject", G_LOG_LEVEL_WARNING,
+ g_test_expect_message ("GLib-GObject", G_LOG_LEVEL_CRITICAL,
"*: instance '*' has no handler with id '*'");
g_signal_handler_disconnect (object2, signal_id);
g_test_assert_expected_messages ();
/* and from an object of the wrong type */
- g_test_expect_message ("GLib-GObject", G_LOG_LEVEL_WARNING,
+ g_test_expect_message ("GLib-GObject", G_LOG_LEVEL_CRITICAL,
"*: instance '*' has no handler with id '*'");
g_signal_handler_disconnect (object3, signal_id);
g_test_assert_expected_messages ();
@@ -1586,7 +1586,7 @@ test_clear_signal_handler (void)
if (g_test_undefined ())
{
handler = g_random_int_range (0x01, 0xFF);
- g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING,
+ g_test_expect_message (G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL,
"*instance '* has no handler with id *'");
g_clear_signal_handler (&handler, test_obj);
g_assert_cmpuint (handler, ==, 0);
@@ -1642,7 +1642,7 @@ test_lookup_invalid (void)
g_test_trap_subprocess (NULL, 0, G_TEST_SUBPROCESS_DEFAULT);
g_test_trap_assert_failed ();
- g_test_trap_assert_stderr ("*WARNING*unable to look up invalid signal name*");
+ g_test_trap_assert_stderr ("*CRITICAL*unable to look up invalid signal name*");
}
static void
diff --git a/gobject/tests/type-flags.c b/gobject/tests/type-flags.c
index 249153b555..cc05e4a43c 100644
--- a/gobject/tests/type-flags.c
+++ b/gobject/tests/type-flags.c
@@ -62,7 +62,7 @@ test_type_flags_final (void)
GType final2_type;
/* This is the message we print out when registering the type */
- g_test_expect_message ("GLib-GObject", G_LOG_LEVEL_WARNING,
+ g_test_expect_message ("GLib-GObject", G_LOG_LEVEL_CRITICAL,
"*cannot derive*");
/* This is the message when we fail to return from the GOnce init
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]