From ad80ff8f8564e009ec0926d71d477e211e4d38fe Mon Sep 17 00:00:00 2001 From: Laria Carolin Chabowski Date: Tue, 8 Feb 2022 21:38:37 +0100 Subject: [PATCH] Remove dead code --- src/apfl.h | 7 ------- src/expr.c | 14 -------------- src/value.c | 41 ----------------------------------------- src/value.h | 1 - 4 files changed, 63 deletions(-) diff --git a/src/apfl.h b/src/apfl.h index 76ca206..7a779f1 100644 --- a/src/apfl.h +++ b/src/apfl.h @@ -257,11 +257,6 @@ struct apfl_expr_param_predicate { struct apfl_expr *rhs; }; -struct apfl_expr_param_list { - struct apfl_expr_param *children; - size_t len; -}; - enum apfl_expr_param_type { APFL_EXPR_PARAM_VAR, APFL_EXPR_PARAM_CONSTANT, @@ -411,7 +406,6 @@ void apfl_expr_call_deinit(struct apfl_expr_call *); void apfl_expr_body_unref(struct apfl_expr_body *); void apfl_expr_const_deinit(struct apfl_expr_const *); void apfl_expr_param_predicate_deinit(struct apfl_expr_param_predicate *); -void apfl_expr_param_list_deinit(struct apfl_expr_param_list *); void apfl_expr_params_deinit(struct apfl_expr_params *); void apfl_expr_params_item_deinit(struct apfl_expr_params_item *); void apfl_expr_param_deinit(struct apfl_expr_param *); @@ -441,7 +435,6 @@ struct apfl_expr_call apfl_expr_call_move(struct apfl_expr_c struct apfl_expr_body * apfl_expr_body_move(struct apfl_expr_body **); struct apfl_expr_const apfl_expr_const_move(struct apfl_expr_const *); struct apfl_expr_param_predicate apfl_expr_param_predicate_move(struct apfl_expr_param_predicate *); -struct apfl_expr_param_list apfl_expr_param_list_move(struct apfl_expr_param_list *); struct apfl_expr_params apfl_expr_params_move(struct apfl_expr_params *); struct apfl_expr_param apfl_expr_param_move(struct apfl_expr_param *); struct apfl_expr_subfunc apfl_expr_subfunc_move(struct apfl_expr_subfunc *); diff --git a/src/expr.c b/src/expr.c index 26ca4cd..a2dc78f 100644 --- a/src/expr.c +++ b/src/expr.c @@ -118,12 +118,6 @@ apfl_expr_param_predicate_deinit(struct apfl_expr_param_predicate *pred) DEINIT_GENERIC_LHS_RHS_EXPR(pred, apfl_expr_param_deinit); } -void -apfl_expr_param_list_deinit(struct apfl_expr_param_list *list) -{ - DEINIT_LIST(list->children, list->len, apfl_expr_param_deinit); -} - void apfl_expr_params_deinit(struct apfl_expr_params *params) { @@ -402,14 +396,6 @@ apfl_expr_param_predicate_move(struct apfl_expr_param_predicate *in) return out; } -struct apfl_expr_param_list -apfl_expr_param_list_move(struct apfl_expr_param_list *in) -{ - struct apfl_expr_param_list out; - MOVE_LIST(out, in, children, len); - return out; -} - struct apfl_expr_params apfl_expr_params_move(struct apfl_expr_params *in) { diff --git a/src/value.c b/src/value.c index a7dc686..4262676 100644 --- a/src/value.c +++ b/src/value.c @@ -327,47 +327,6 @@ apfl_editable_list_new(void) return elist; } -apfl_editable_list -apfl_editable_list_new_from_list(apfl_list list) -{ - if (list == NULL) { - return NULL; - } - - apfl_editable_list elist = ALLOC(struct apfl_editable_list_data); - if (elist == NULL) { - apfl_list_unref(list); - return NULL; - } - - if (list->refcount == 1) { - // We're the only one with a reference to the list, so we can directly use the items of the list! - elist->items = list->items; - elist->len = list->len; - elist->cap = list->len; - } else { - // We first need to create a shallow copy of the elements - if (list->len != 0) { - if ((elist->items = ALLOC_LIST(struct apfl_value, list->len)) == NULL) { - apfl_list_unref(list); - free(elist); - return NULL; - } - } - - for (size_t i = 0; i < list->len; i++) { - elist->items[i] = apfl_value_incref(list->items[i]); - } - - elist->len = list->len; - elist->cap = list->len; - } - - apfl_list_unref(list); - - return elist; -} - static bool editable_list_append_values(apfl_editable_list elist, struct apfl_value *values, size_t len) { diff --git a/src/value.h b/src/value.h index e00eb99..e3c0740 100644 --- a/src/value.h +++ b/src/value.h @@ -66,7 +66,6 @@ struct apfl_editable_list_data; typedef struct apfl_editable_list_data *apfl_editable_list; apfl_editable_list apfl_editable_list_new(void); -apfl_editable_list apfl_editable_list_new_from_list(apfl_list); bool apfl_editable_list_append(apfl_editable_list, struct apfl_value); bool apfl_editable_list_append_list(apfl_editable_list, apfl_list); void apfl_editable_list_destroy(apfl_editable_list);