qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v5 01/14] qapi: make visit_type_size fallback to v->


From: Hu Tao
Subject: [Qemu-devel] [PATCH v5 01/14] qapi: make visit_type_size fallback to v->type_int()
Date: Wed, 26 Jun 2013 17:13:24 +0800

In case of v->type_uint64 is NULL, fallback to v->type_int, by calling
visit_type_uint64().

Signed-off-by: Vasilis Liaskovitis <address@hidden>
Signed-off-by: Hu Tao <address@hidden>
---
 qapi/qapi-visit-core.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/qapi/qapi-visit-core.c b/qapi/qapi-visit-core.c
index 401ee6e..7ae2061 100644
--- a/qapi/qapi-visit-core.c
+++ b/qapi/qapi-visit-core.c
@@ -239,7 +239,11 @@ void visit_type_int64(Visitor *v, int64_t *obj, const char 
*name, Error **errp)
 void visit_type_size(Visitor *v, uint64_t *obj, const char *name, Error **errp)
 {
     if (!error_is_set(errp)) {
-        (v->type_size ? v->type_size : v->type_uint64)(v, obj, name, errp);
+        if (v->type_size) {
+            v->type_size(v, obj, name, errp);
+        } else {
+            visit_type_uint64(v, obj, name, errp);
+        }
     }
 }
 
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]