From ece07d2e1aa3e5218f18ebf7e0fa19e6a3062a47 Mon Sep 17 00:00:00 2001 From: Lassi Kortela Date: Fri, 9 Aug 2019 19:21:55 +0300 Subject: [PATCH] Replace cvtable_t with struct --- c/flisp.h | 10 +++++----- c/iostream.c | 4 ++-- c/table.c | 4 ++-- c/types.h | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/c/flisp.h b/c/flisp.h index eb46a09..be5977f 100644 --- a/c/flisp.h +++ b/c/flisp.h @@ -211,14 +211,14 @@ static inline void argcount(char *fname, uint32_t nargs, uint32_t c) nargs < c ? "few" : "many"); } -typedef struct { +struct cvtable { void (*print)(value_t self, struct ios *f); void (*relocate)(value_t oldv, value_t newv); void (*finalize)(value_t self); void (*print_traverse)(value_t self); -} cvtable_t; +}; -/* functions needed to implement the value interface (cvtable_t) */ +/* functions needed to implement the value interface (struct cvtable) */ typedef enum { T_INT8, T_UINT8, @@ -255,7 +255,7 @@ typedef struct _fltype_t { numerictype_t numtype; size_t size; size_t elsz; - cvtable_t *vtable; + struct cvtable *vtable; struct _fltype_t *eltype; // for arrays struct _fltype_t *artype; // (array this) int marked; @@ -375,7 +375,7 @@ void to_sized_ptr(value_t v, char *fname, char **pdata, size_t *psz); fltype_t *get_type(value_t t); fltype_t *get_array_type(value_t eltype); -fltype_t *define_opaque_type(value_t sym, size_t sz, cvtable_t *vtab, +fltype_t *define_opaque_type(value_t sym, size_t sz, struct cvtable *vtab, cvinitfunc_t init); value_t mk_double(fl_double_t n); diff --git a/c/iostream.c b/c/iostream.c index d7bb3f7..9a67d12 100644 --- a/c/iostream.c +++ b/c/iostream.c @@ -48,8 +48,8 @@ void relocate_iostream(value_t oldv, value_t newv) } } -cvtable_t iostream_vtable = { print_iostream, relocate_iostream, - free_iostream, NULL }; +struct cvtable iostream_vtable = { print_iostream, relocate_iostream, + free_iostream, NULL }; int fl_isiostream(value_t v) { diff --git a/c/table.c b/c/table.c index 76e0fdc..794fe3a 100644 --- a/c/table.c +++ b/c/table.c @@ -77,8 +77,8 @@ void relocate_htable(value_t oldv, value_t newv) } } -cvtable_t table_vtable = { print_htable, relocate_htable, free_htable, - print_traverse_htable }; +struct cvtable table_vtable = { print_htable, relocate_htable, free_htable, + print_traverse_htable }; int ishashtable(value_t v) { diff --git a/c/types.h b/c/types.h index a5b3ec8..09d10a0 100644 --- a/c/types.h +++ b/c/types.h @@ -64,7 +64,7 @@ fltype_t *get_array_type(value_t eltype) return et->artype; } -fltype_t *define_opaque_type(value_t sym, size_t sz, cvtable_t *vtab, +fltype_t *define_opaque_type(value_t sym, size_t sz, struct cvtable *vtab, cvinitfunc_t init) { fltype_t *ft = (fltype_t *)malloc(sizeof(fltype_t));