[json-glib/wip/hughsie/typecheck] trivial: Return the correct type in g_return_val_if_fail()
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [json-glib/wip/hughsie/typecheck] trivial: Return the correct type in g_return_val_if_fail()
- Date: Sun, 16 May 2021 10:27:12 +0000 (UTC)
commit d2ecf1a426401c666a9515987b49431900157794
Author: Richard Hughes <richard hughsie com>
Date: Sun May 16 11:26:08 2021 +0100
trivial: Return the correct type in g_return_val_if_fail()
json-glib/json-generator.c | 2 +-
json-glib/json-gobject.c | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/json-glib/json-generator.c b/json-glib/json-generator.c
index 4ccf320..ed181c5 100644
--- a/json-glib/json-generator.c
+++ b/json-glib/json-generator.c
@@ -749,7 +749,7 @@ json_generator_set_indent (JsonGenerator *generator,
guint
json_generator_get_indent (JsonGenerator *generator)
{
- g_return_val_if_fail (JSON_IS_GENERATOR (generator), FALSE);
+ g_return_val_if_fail (JSON_IS_GENERATOR (generator), 0);
return generator->priv->indent;
}
diff --git a/json-glib/json-gobject.c b/json-glib/json-gobject.c
index b42dc83..1e7bf2c 100644
--- a/json-glib/json-gobject.c
+++ b/json-glib/json-gobject.c
@@ -57,8 +57,8 @@ enum_from_string (GType type,
gint value;
gboolean retval = TRUE;
- g_return_val_if_fail (G_TYPE_IS_ENUM (type), 0);
- g_return_val_if_fail (string != NULL, 0);
+ g_return_val_if_fail (G_TYPE_IS_ENUM (type), FALSE);
+ g_return_val_if_fail (string != NULL, FALSE);
value = strtoul (string, &endptr, 0);
if (endptr != string) /* parsed a number */
@@ -95,8 +95,8 @@ flags_from_string (GType type,
gunichar ch;
gboolean eos;
- g_return_val_if_fail (G_TYPE_IS_FLAGS (type), 0);
- g_return_val_if_fail (string != 0, 0);
+ g_return_val_if_fail (G_TYPE_IS_FLAGS (type), FALSE);
+ g_return_val_if_fail (string != 0, FALSE);
ret = TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]