[pulseaudio-discuss] [PATCH 4/4] format: Don't use deprecated json-c is_error() macro

Peter Meerwald pmeerw at pmeerw.net
Fri Aug 22 06:43:36 PDT 2014


> > json_tokener_parse() simply returns NULL on error these days
> > 
> > latest json-c (post 0.12) doesn't automatically include json-c/bits.h anymore
> > causing compilation errors
> > 
> > Signed-off-by: Peter Meerwald <pmeerw at pmeerw.net>
> > ---
> >  src/pulse/format.c |   18 +++++++++---------
> >  1 file changed, 9 insertions(+), 9 deletions(-)
> > 
> > diff --git a/src/pulse/format.c b/src/pulse/format.c
> > index 995e3df..e0a2d98 100644
> > --- a/src/pulse/format.c
> > +++ b/src/pulse/format.c
> > @@ -249,7 +249,7 @@ pa_prop_type_t pa_format_info_get_prop_type(const pa_format_info *f, const char
> >          return PA_PROP_TYPE_INVALID;
> >  
> >      o = json_tokener_parse(str);
> > -    if (is_error(o))
> > +    if (!o)
> >          return PA_PROP_TYPE_INVALID;
> >  
> >      switch (json_object_get_type(o)) {
> > @@ -289,7 +289,7 @@ pa_prop_type_t pa_format_info_get_prop_type(const pa_format_info *f, const char
> >                  break;
> >              }
> >  
> > -            if (!json_object_object_get_ex(o, PA_JSON_MAX_KEY, NULL) {
> > +            if (!json_object_object_get_ex(o, PA_JSON_MAX_KEY, NULL)) {
> 
> Looks like this change should really be part of the commit that
> introduces json_object_object_get_ex().
> 
> Otherwise, the patches look good, so please fix this then go ahead and
> push.

uups, yes;
I applied this series now

there were several more locations using json_object_array_get_idx() where 
json_object_put() was incorrectly called (first patch)

thanks, p.

-- 

Peter Meerwald
+43-664-2444418 (mobile)


More information about the pulseaudio-discuss mailing list