diff options
author | Jo-Philipp Wich <jo@mein.io> | 2021-04-27 00:35:20 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2021-04-27 12:18:32 +0200 |
commit | 64eec7f90e945696572ee076b75d1f35e8f2248a (patch) | |
tree | f61121e8f89e39787a960e621fc8492e57fc4bc0 /chunk.h | |
parent | 4af803d76e4c08ff5661c2b37dbd333f3aba866d (diff) |
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 <jo@mein.io>
Diffstat (limited to 'chunk.h')
-rw-r--r-- | chunk.h | 28 |
1 files changed, 1 insertions, 27 deletions
@@ -22,38 +22,12 @@ #include "value.h" #include "util.h" - - -typedef struct { - size_t from, to, target, slot; -} uc_ehrange; - -typedef struct { - size_t from, to, slot, nameidx; -} uc_varrange; - -uc_declare_vector(uc_ehranges, uc_ehrange); -uc_declare_vector(uc_variables, uc_varrange); -uc_declare_vector(uc_offsetinfo, uint8_t); - -typedef struct { - size_t count; - uint8_t *entries; - uc_value_list constants; - uc_ehranges ehranges; - struct { - uc_variables variables; - uc_value_list varnames; - uc_offsetinfo offsets; - } debuginfo; -} uc_chunk; +#include "types.h" void uc_chunk_init(uc_chunk *chunk); void uc_chunk_free(uc_chunk *chunk); size_t uc_chunk_add(uc_chunk *chunk, uint8_t byte, size_t line); -typedef struct uc_value_t uc_value_t; - ssize_t uc_chunk_add_constant(uc_chunk *chunk, uc_value_t *value); uc_value_t *uc_chunk_get_constant(uc_chunk *chunk, size_t idx); void uc_chunk_pop(uc_chunk *chunk); |