[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 2/6] json: Implement wrapping interface
From: |
Patrick Steinhardt |
Subject: |
Re: [PATCH v4 2/6] json: Implement wrapping interface |
Date: |
Mon, 18 Nov 2019 16:46:45 +0100 |
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.
Patrick
signature.asc
Description: PGP signature
- Re: [PATCH v3 1/6] json: Import upstream jsmn-1.1.0, (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