From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: [PATCH 33/34] tools/libxl: libxl__json_object_to_yajl_gen should return yajl_gen_status Date: Tue, 25 Mar 2014 16:55:40 +0000 Message-ID: <1395766541-23979-34-git-send-email-julien.grall@linaro.org> References: <1395766541-23979-1-git-send-email-julien.grall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WSUep-00012T-2d for xen-devel@lists.xenproject.org; Tue, 25 Mar 2014 16:56:59 +0000 Received: by mail-ee0-f54.google.com with SMTP id d49so676057eek.41 for ; Tue, 25 Mar 2014 09:56:57 -0700 (PDT) In-Reply-To: <1395766541-23979-1-git-send-email-julien.grall@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org Cc: ian.campbell@citrix.com, Stefano Stabellini , tim@xen.org, Julien Grall , Ian Jackson , stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org 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 Cc: Ian Jackson Cc: Stefano Stabellini Cc: Ian Campbell --- 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