Re: [PATCH 2/9] util: json: Add virJSONValueIsObject

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

 



On Tue, Jun 27, 2017 at 17:55:40 +0200, Bjoern Walk wrote:
> Peter Krempa <pkrempa@xxxxxxxxxx> [2017-06-27, 02:46PM +0200]:
> > Allows testing whether a virJSONValue is an object.
> > ---
> >  src/libvirt_private.syms |  1 +
> >  src/util/virjson.c       | 10 ++++++++++
> >  src/util/virjson.h       |  2 ++
> >  3 files changed, 13 insertions(+)

[...]

> > diff --git a/src/util/virjson.c b/src/util/virjson.c
> > index b49b29b0f..efd6c3a0e 100644
> > --- a/src/util/virjson.c
> > +++ b/src/util/virjson.c
> > @@ -905,6 +905,16 @@ virJSONValueObjectGetValue(virJSONValuePtr object,
> > 
> > 
> >  bool
> > +virJSONValueIsObject(virJSONValuePtr object)
> > +{
> > +    if (object)
> > +        return object->type == VIR_JSON_TYPE_OBJECT;
> > +    else
> > +        return NULL;
> 
> s/NULL/false/

Thanks! It's a shame we don't have 'nullptr' like functionality in C.

Attachment: signature.asc
Description: Digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux