[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
- [PATCH v3 5/6] luks: Move configuration of ciphers into cryptodisk, (continued)
[PATCH v4 0/6] Support for LUKS2 disk encryption, Patrick Steinhardt, 2019/11/18
[PATCH v4 1/6] json: Import upstream jsmn-1.1.0, Patrick Steinhardt, 2019/11/18
[PATCH v4 5/6] luks: Move configuration of ciphers into cryptodisk, Patrick Steinhardt, 2019/11/18
[PATCH v4 6/6] disk: Implement support for LUKS2, Patrick Steinhardt, 2019/11/18
[PATCH v5 0/6] Support for LUKS2 disk encryption, Patrick Steinhardt, 2019/11/29
- [PATCH v5 4/6] afsplitter: Move into its own module, Patrick Steinhardt, 2019/11/29
- [PATCH v5 1/6] json: Import upstream jsmn-1.1.0, Patrick Steinhardt, 2019/11/29
- [PATCH v5 6/6] disk: Implement support for LUKS2, Patrick Steinhardt, 2019/11/29
- [PATCH v5 5/6] luks: Move configuration of ciphers into cryptodisk, Patrick Steinhardt, 2019/11/29
- [PATCH v5 2/6] json: Implement wrapping interface, Patrick Steinhardt, 2019/11/29