From: Ian Campbell Subject: Re: [PATCH V2 3/9] libxl_json: Introduce libxl__json_object_to_yajl_gen. Date: Tue, 25 Sep 2012 09:44:44 +0100 Message-ID: <1348562684.3452.116.camel@zakaz.uk.xensource.com> References: <1347906148-9606-1-git-send-email-anthony.perard@citrix.com> <1347906148-9606-4-git-send-email-anthony.perard@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1347906148-9606-4-git-send-email-anthony.perard@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Anthony PERARD Cc: Ian Jackson , Xen Devel List-Id: xen-devel@lists.xenproject.org On Mon, 2012-09-17 at 19:22 +0100, Anthony PERARD wrote: > This function converts a libxl__json_object to yajl by calling every yajl_gen_* > function on a preallocated yajl_gen hand. > > This helps to integrate a json_object into an already existing yajl_gen tree. > > This function is used in a later patch. > > Signed-off-by: Anthony PERARD > --- > tools/libxl/libxl_internal.h | 3 +++ > tools/libxl/libxl_json.c | 63 ++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 66 insertions(+) > > diff --git a/tools/libxl/libxl_internal.h b/tools/libxl/libxl_internal.h > index 3c2dcaa..9c1482d 100644 > --- a/tools/libxl/libxl_internal.h > +++ b/tools/libxl/libxl_internal.h > [...] > + } > + case JSON_ERROR: I can't see this being used anywhere, could it just be removed from the enum? > + case JSON_ANY: Is JSON_ANY sort of like a JSON "void *"? Is it ever valid to be passed one here, IOW does this represent a coding error (==abort()) or a run time one (== log something)? > + default: If you skip this default case then some compilers will warn (a runtime error) if we forget to add a new JSON_FOO here. > + return -1; > + } > +} > + > > /* > * JSON callbacks