From 64eec7f90e945696572ee076b75d1f35e8f2248a Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Tue, 27 Apr 2021 00:35:20 +0200 Subject: treewide: ISO C / pedantic compliance - Shuffle typedefs to avoid need for non-compliant forward declarations - Fix non-compliant empty struct initializers - Remove use of braced expressions - Remove use of anonymous unions - Avoid `void *` pointer arithmetic - Fix several warnings reported by gcc -pedantic mode and clang 11 compilation Signed-off-by: Jo-Philipp Wich --- value.h | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'value.h') diff --git a/value.h b/value.h index 770279e..a3abfc6 100644 --- a/value.h +++ b/value.h @@ -29,6 +29,8 @@ #include +#include "types.h" + typedef enum { TAG_INVAL = 0, TAG_NUM = 1, @@ -39,24 +41,11 @@ typedef enum { TAG_PTR = 6 } uc_value_type_t; -typedef struct { - size_t isize; - size_t dsize; - uint64_t *index; - char *data; -} uc_value_list; - -typedef struct uc_value_t uc_value_t; - bool uc_cmp(int how, uc_value_t *v1, uc_value_t *v2); bool uc_val_is_truish(uc_value_t *val); -typedef enum uc_type_t uc_type_t; -typedef struct uc_value_t uc_value_t; uc_type_t uc_cast_number(uc_value_t *v, int64_t *n, double *d); -typedef struct uc_vm uc_vm; - uc_value_t *uc_getval(uc_vm *, uc_value_t *scope, uc_value_t *key); uc_value_t *uc_setval(uc_vm *, uc_value_t *scope, uc_value_t *key, uc_value_t *val); -- cgit v1.2.3