json: Get rid of casts for "jsmntok_t"

With the upstream change having landed that adds a name to the
previously anonymous "jsmntok" typedef, we can now add a forward
declaration for that struct in our code. As a result, we no longer have
to store the "tokens" member of "struct grub_json" as a void pointer but
can instead use the forward declaration, allowing us to get rid of casts
of that field.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
This commit is contained in:
Patrick Steinhardt 2020-04-16 12:20:15 +02:00 committed by Daniel Kiper
parent 3b81607b55
commit e933feb578
2 changed files with 7 additions and 5 deletions

View file

@ -36,9 +36,11 @@ enum grub_json_type
};
typedef enum grub_json_type grub_json_type_t;
typedef struct jsmntok jsmntok_t;
struct grub_json
{
void *tokens;
jsmntok_t *tokens;
char *string;
grub_size_t idx;
};