aboutsummaryrefslogtreecommitdiff
path: root/qobject
diff options
context:
space:
mode:
authorPierrick Bouvier <pierrick.bouvier@linaro.org>2024-09-18 21:46:12 -0700
committerThomas Huth <thuth@redhat.com>2024-09-24 13:53:35 +0200
commit890000dd3bd13c7421a2895c7300f410940eb0f0 (patch)
tree5bb6aeddc89d3bf8b37afb33d67e483c5b3e4f9f /qobject
parent0c79effdc7a839cff1e2af564cc145584271038d (diff)
downloadqemu-890000dd3bd13c7421a2895c7300f410940eb0f0.zip
qemu-890000dd3bd13c7421a2895c7300f410940eb0f0.tar.gz
qemu-890000dd3bd13c7421a2895c7300f410940eb0f0.tar.bz2
qobject: replace assert(0) with g_assert_not_reached()
This patch is part of a series that moves towards a consistent use of g_assert_not_reached() rather than an ad hoc mix of different assertion mechanisms. Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Reviewed-by: Kevin Wolf <kwolf@redhat.com> Signed-off-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Message-ID: <20240919044641.386068-6-pierrick.bouvier@linaro.org> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'qobject')
-rw-r--r--qobject/qlit.c2
-rw-r--r--qobject/qnum.c8
2 files changed, 5 insertions, 5 deletions
diff --git a/qobject/qlit.c b/qobject/qlit.c
index be83321..a62865b 100644
--- a/qobject/qlit.c
+++ b/qobject/qlit.c
@@ -118,7 +118,7 @@ QObject *qobject_from_qlit(const QLitObject *qlit)
case QTYPE_QBOOL:
return QOBJECT(qbool_from_bool(qlit->value.qbool));
default:
- assert(0);
+ g_assert_not_reached();
}
return NULL;
diff --git a/qobject/qnum.c b/qobject/qnum.c
index 2bbeaed..2138b56 100644
--- a/qobject/qnum.c
+++ b/qobject/qnum.c
@@ -85,7 +85,7 @@ bool qnum_get_try_int(const QNum *qn, int64_t *val)
return false;
}
- assert(0);
+ g_assert_not_reached();
return false;
}
@@ -123,7 +123,7 @@ bool qnum_get_try_uint(const QNum *qn, uint64_t *val)
return false;
}
- assert(0);
+ g_assert_not_reached();
return false;
}
@@ -156,7 +156,7 @@ double qnum_get_double(QNum *qn)
return qn->u.dbl;
}
- assert(0);
+ g_assert_not_reached();
return 0.0;
}
@@ -172,7 +172,7 @@ char *qnum_to_string(QNum *qn)
return g_strdup_printf("%.17g", qn->u.dbl);
}
- assert(0);
+ g_assert_not_reached();
return NULL;
}