From cb51b976babf7ee16dc5eda4f2189d65b8b700a3 Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Sat, 24 Feb 2018 16:40:30 +0100 Subject: qapi: Remove qobject_to_X() functions They are no longer needed now. Signed-off-by: Max Reitz Reviewed-by: Alberto Garcia Message-Id: <20180224154033.29559-5-mreitz@redhat.com> Reviewed-by: Eric Blake Signed-off-by: Eric Blake --- qobject/qbool.c | 11 ----------- qobject/qdict.c | 11 ----------- qobject/qlist.c | 11 ----------- qobject/qnum.c | 11 ----------- qobject/qstring.c | 11 ----------- 5 files changed, 55 deletions(-) (limited to 'qobject') diff --git a/qobject/qbool.c b/qobject/qbool.c index 5be6277..b582499 100644 --- a/qobject/qbool.c +++ b/qobject/qbool.c @@ -40,17 +40,6 @@ bool qbool_get_bool(const QBool *qb) } /** - * qobject_to_qbool(): Convert a QObject into a QBool - */ -QBool *qobject_to_qbool(const QObject *obj) -{ - if (!obj || qobject_type(obj) != QTYPE_QBOOL) { - return NULL; - } - return container_of(obj, QBool, base); -} - -/** * qbool_is_equal(): Test whether the two QBools are equal */ bool qbool_is_equal(const QObject *x, const QObject *y) diff --git a/qobject/qdict.c b/qobject/qdict.c index 1e58812..45c8b53 100644 --- a/qobject/qdict.c +++ b/qobject/qdict.c @@ -38,17 +38,6 @@ QDict *qdict_new(void) } /** - * qobject_to_qdict(): Convert a QObject into a QDict - */ -QDict *qobject_to_qdict(const QObject *obj) -{ - if (!obj || qobject_type(obj) != QTYPE_QDICT) { - return NULL; - } - return container_of(obj, QDict, base); -} - -/** * tdb_hash(): based on the hash agorithm from gdbm, via tdb * (from module-init-tools) */ diff --git a/qobject/qlist.c b/qobject/qlist.c index 77f19ff..954fe98 100644 --- a/qobject/qlist.c +++ b/qobject/qlist.c @@ -152,17 +152,6 @@ size_t qlist_size(const QList *qlist) } /** - * qobject_to_qlist(): Convert a QObject into a QList - */ -QList *qobject_to_qlist(const QObject *obj) -{ - if (!obj || qobject_type(obj) != QTYPE_QLIST) { - return NULL; - } - return container_of(obj, QList, base); -} - -/** * qlist_is_equal(): Test whether the two QLists are equal * * In order to be considered equal, the respective two objects at each diff --git a/qobject/qnum.c b/qobject/qnum.c index ea091cf..1501c82 100644 --- a/qobject/qnum.c +++ b/qobject/qnum.c @@ -200,17 +200,6 @@ char *qnum_to_string(QNum *qn) } /** - * qobject_to_qnum(): Convert a QObject into a QNum - */ -QNum *qobject_to_qnum(const QObject *obj) -{ - if (!obj || qobject_type(obj) != QTYPE_QNUM) { - return NULL; - } - return container_of(obj, QNum, base); -} - -/** * qnum_is_equal(): Test whether the two QNums are equal * * Negative integers are never considered equal to unsigned integers, diff --git a/qobject/qstring.c b/qobject/qstring.c index 2b21532..8bae529 100644 --- a/qobject/qstring.c +++ b/qobject/qstring.c @@ -106,17 +106,6 @@ void qstring_append_chr(QString *qstring, int c) } /** - * qobject_to_qstring(): Convert a QObject to a QString - */ -QString *qobject_to_qstring(const QObject *obj) -{ - if (!obj || qobject_type(obj) != QTYPE_QSTRING) { - return NULL; - } - return container_of(obj, QString, base); -} - -/** * qstring_get_str(): Return a pointer to the stored string * * NOTE: Should be used with caution, if the object is deallocated -- cgit v1.1