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

[Xen-devel] [PATCH 33/34] tools/libxl: libxl__json_object_to_yajl_gen should return yajl_gen_status



All the functions in lixbl__json_object_to_yajl_gen returns an yajl_gen_status
enum.

Also replace yal_gen_status_ok by yalj_gen_status_ok.

This is fix compilation with clang 3.5:
libxl_json.c:378:16: error: implicit conversion from enumeration type 
'yajl_gen_status' to different enumeration type 'yajl_status' 
[-Werror,-Wenum-conversion]
        return yajl_gen_null(hand);
        ~~~~~~ ^~~~~~~~~~~~~~~~~~~

Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx>
Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Cc: Ian Campbell <ian.campbell@xxxxxxxxxx>
---
 tools/libxl/libxl_internal.h |    2 +-
 tools/libxl/libxl_json.c     |   18 +++++++++---------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h
index b3a200d..bfefd31 100644
--- a/tools/libxl/libxl_internal.h
+++ b/tools/libxl/libxl_internal.h
@@ -1722,7 +1722,7 @@ libxl__json_map_node *libxl__json_map_node_get(const 
libxl__json_object *o,
 _hidden const libxl__json_object *libxl__json_map_get(const char *key,
                                           const libxl__json_object *o,
                                           libxl__json_node_type expected_type);
-_hidden yajl_status libxl__json_object_to_yajl_gen(libxl__gc *gc_opt,
+_hidden yajl_gen_status libxl__json_object_to_yajl_gen(libxl__gc *gc_opt,
                                                    yajl_gen hand,
                                                    libxl__json_object *param);
 _hidden void libxl__json_object_free(libxl__gc *gc_opt,
diff --git a/tools/libxl/libxl_json.c b/tools/libxl/libxl_json.c
index d2f7de8..8e28c58 100644
--- a/tools/libxl/libxl_json.c
+++ b/tools/libxl/libxl_json.c
@@ -366,12 +366,12 @@ const libxl__json_object *libxl__json_map_get(const char 
*key,
     return NULL;
 }
 
-yajl_status libxl__json_object_to_yajl_gen(libxl__gc *gc,
-                                           yajl_gen hand,
-                                           libxl__json_object *obj)
+yajl_gen_status libxl__json_object_to_yajl_gen(libxl__gc *gc,
+                                               yajl_gen hand,
+                                               libxl__json_object *obj)
 {
     int idx = 0;
-    yajl_status rc;
+    yajl_gen_status rc;
 
     switch (obj->type) {
     case JSON_NULL:
@@ -390,17 +390,17 @@ yajl_status libxl__json_object_to_yajl_gen(libxl__gc *gc,
         libxl__json_map_node *node = NULL;
 
         rc = yajl_gen_map_open(hand);
-        if (rc != yajl_status_ok)
+        if (rc != yajl_gen_status_ok)
             return rc;
         for (idx = 0; idx < obj->u.map->count; idx++) {
             if (flexarray_get(obj->u.map, idx, (void**)&node) != 0)
                 break;
 
             rc = libxl__yajl_gen_asciiz(hand, node->map_key);
-            if (rc != yajl_status_ok)
+            if (rc != yajl_gen_status_ok)
                 return rc;
             rc = libxl__json_object_to_yajl_gen(gc, hand, node->obj);
-            if (rc != yajl_status_ok)
+            if (rc != yajl_gen_status_ok)
                 return rc;
         }
         return yajl_gen_map_close(hand);
@@ -409,13 +409,13 @@ yajl_status libxl__json_object_to_yajl_gen(libxl__gc *gc,
         libxl__json_object *node = NULL;
 
         rc = yajl_gen_array_open(hand);
-        if (rc != yajl_status_ok)
+        if (rc != yajl_gen_status_ok)
             return rc;
         for (idx = 0; idx < obj->u.array->count; idx++) {
             if (flexarray_get(obj->u.array, idx, (void**)&node) != 0)
                 break;
             rc = libxl__json_object_to_yajl_gen(gc, hand, node);
-            if (rc != yajl_status_ok)
+            if (rc != yajl_gen_status_ok)
                 return rc;
         }
         return yajl_gen_array_close(hand);
-- 
1.7.10.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.