grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v4 2/6] json: Implement wrapping interface


From: Daniel Kiper
Subject: Re: [PATCH v4 2/6] json: Implement wrapping interface
Date: Mon, 18 Nov 2019 17:29:05 +0100
User-agent: NeoMutt/20170113 (1.7.2)

On Mon, Nov 18, 2019 at 04:46:45PM +0100, Patrick Steinhardt wrote:
> On Mon, Nov 18, 2019 at 03:14:15PM +0100, Daniel Kiper wrote:
> > On Mon, Nov 18, 2019 at 09:45:13AM +0100, Patrick Steinhardt wrote:
> > > +grub_size_t
> > > +grub_json_getsize (const grub_json_t *json)
> > > +{
> > > +  jsmntok_t *p = &((jsmntok_t *)json->tokens)[json->idx];
> >
> > I still have a feeling that you should check at lease *json for NULL.
> > If not json->tokens and json->idx. However, then you should return
> > grub_ssize_t.
>
> Ok, will change. I'm a bit on the edge here, though, as the
> interface is inconsistent with all the other getters. Should we
> maybe use an out-parameter instead and return `grub_err_t`?
> While it'd make the interface a bit more unwieldy, it would be
> more in line with the rest of this module's interface.

Works for me.

Daniel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]