aboutsummaryrefslogtreecommitdiff
path: root/qapi/qobject-output-visitor.c
diff options
context:
space:
mode:
Diffstat (limited to 'qapi/qobject-output-visitor.c')
-rw-r--r--qapi/qobject-output-visitor.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/qapi/qobject-output-visitor.c b/qapi/qobject-output-visitor.c
index 26d7be5ec9..ba6f6ac8a7 100644
--- a/qapi/qobject-output-visitor.c
+++ b/qapi/qobject-output-visitor.c
@@ -103,7 +103,7 @@ static void qobject_output_add_obj(QObjectOutputVisitor *qov, const char *name,
}
}
-static void qobject_output_start_struct(Visitor *v, const char *name,
+static bool qobject_output_start_struct(Visitor *v, const char *name,
void **obj, size_t unused, Error **errp)
{
QObjectOutputVisitor *qov = to_qov(v);
@@ -111,6 +111,7 @@ static void qobject_output_start_struct(Visitor *v, const char *name,
qobject_output_add(qov, name, dict);
qobject_output_push(qov, dict, obj);
+ return true;
}
static void qobject_output_end_struct(Visitor *v, void **obj)
@@ -120,7 +121,7 @@ static void qobject_output_end_struct(Visitor *v, void **obj)
assert(qobject_type(value) == QTYPE_QDICT);
}
-static void qobject_output_start_list(Visitor *v, const char *name,
+static bool qobject_output_start_list(Visitor *v, const char *name,
GenericList **listp, size_t size,
Error **errp)
{
@@ -129,6 +130,7 @@ static void qobject_output_start_list(Visitor *v, const char *name,
qobject_output_add(qov, name, list);
qobject_output_push(qov, list, listp);
+ return true;
}
static GenericList *qobject_output_next_list(Visitor *v, GenericList *tail,
@@ -144,28 +146,31 @@ static void qobject_output_end_list(Visitor *v, void **obj)
assert(qobject_type(value) == QTYPE_QLIST);
}
-static void qobject_output_type_int64(Visitor *v, const char *name,
+static bool qobject_output_type_int64(Visitor *v, const char *name,
int64_t *obj, Error **errp)
{
QObjectOutputVisitor *qov = to_qov(v);
qobject_output_add(qov, name, qnum_from_int(*obj));
+ return true;
}
-static void qobject_output_type_uint64(Visitor *v, const char *name,
+static bool qobject_output_type_uint64(Visitor *v, const char *name,
uint64_t *obj, Error **errp)
{
QObjectOutputVisitor *qov = to_qov(v);
qobject_output_add(qov, name, qnum_from_uint(*obj));
+ return true;
}
-static void qobject_output_type_bool(Visitor *v, const char *name, bool *obj,
+static bool qobject_output_type_bool(Visitor *v, const char *name, bool *obj,
Error **errp)
{
QObjectOutputVisitor *qov = to_qov(v);
qobject_output_add(qov, name, qbool_from_bool(*obj));
+ return true;
}
-static void qobject_output_type_str(Visitor *v, const char *name, char **obj,
+static bool qobject_output_type_str(Visitor *v, const char *name, char **obj,
Error **errp)
{
QObjectOutputVisitor *qov = to_qov(v);
@@ -174,28 +179,32 @@ static void qobject_output_type_str(Visitor *v, const char *name, char **obj,
} else {
qobject_output_add(qov, name, qstring_from_str(""));
}
+ return true;
}
-static void qobject_output_type_number(Visitor *v, const char *name,
+static bool qobject_output_type_number(Visitor *v, const char *name,
double *obj, Error **errp)
{
QObjectOutputVisitor *qov = to_qov(v);
qobject_output_add(qov, name, qnum_from_double(*obj));
+ return true;
}
-static void qobject_output_type_any(Visitor *v, const char *name,
+static bool qobject_output_type_any(Visitor *v, const char *name,
QObject **obj, Error **errp)
{
QObjectOutputVisitor *qov = to_qov(v);
qobject_output_add_obj(qov, name, qobject_ref(*obj));
+ return true;
}
-static void qobject_output_type_null(Visitor *v, const char *name,
+static bool qobject_output_type_null(Visitor *v, const char *name,
QNull **obj, Error **errp)
{
QObjectOutputVisitor *qov = to_qov(v);
qobject_output_add(qov, name, qnull());
+ return true;
}
/* Finish building, and return the root object.