Skip to content

Commit

Permalink
Remove unused node_data c functions
Browse files Browse the repository at this point in the history
  • Loading branch information
eivindjahren committed Aug 8, 2024
1 parent 7b06748 commit 6411af8
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
4 changes: 0 additions & 4 deletions lib/include/ert/util/node_data.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,14 @@ typedef struct node_data_struct node_data_type;

void node_data_free(node_data_type *);
void node_data_free_container(node_data_type *);
node_data_type *node_data_alloc_deep_copy(const node_data_type *);
node_data_type *node_data_alloc_shallow_copy(const node_data_type *);
node_data_type *node_data_alloc_copy(const node_data_type *node,
bool deep_copy);
void *node_data_get_ptr(const node_data_type *);
const void *node_data_get_const_ptr(const node_data_type *);
node_data_type *node_data_alloc_buffer(const void *, int);
node_data_type *node_data_alloc_ptr(const void *, copyc_ftype *, free_ftype *);

node_data_type *node_data_alloc_int(int);
int node_data_get_int(const node_data_type *);
int node_data_fetch_and_inc_int(node_data_type *node_data);
node_data_type *node_data_alloc_double(double);
double node_data_get_double(const node_data_type *);
node_data_type *node_data_alloc_string(const char *);
Expand Down
23 changes: 0 additions & 23 deletions lib/util/node_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,6 @@ node_data_type *node_data_alloc_copy(const node_data_type *node,
return node_data_copyc(node, deep_copy);
}

node_data_type *node_data_alloc_deep_copy(const node_data_type *node) {
return node_data_copyc(node, true);
}

node_data_type *node_data_alloc_shallow_copy(const node_data_type *node) {
return node_data_copyc(node, false);
}

/**
This function does NOT call the destructor on the data. That means
that calling scope is responsible for freeing the data; used by the
Expand All @@ -128,10 +120,6 @@ void node_data_free(node_data_type *node_data) {
node_data_free_container(node_data);
}

const void *node_data_get_const_ptr(const node_data_type *node_data) {
return node_data->data;
}

void *node_data_get_ptr(const node_data_type *node_data) {
return node_data->data;
}
Expand Down Expand Up @@ -160,17 +148,6 @@ int node_data_get_int(const node_data_type *node_data) {
}
}

int node_data_fetch_and_inc_int(node_data_type *node_data) {
if (node_data->ctype == CTYPE_INT_VALUE) {
int *data = (int *)node_data->data;
(*data) += 1;
return *data;
} else {
util_abort("%s: wrong type \n", __func__);
return 0;
}
}

node_data_type *node_data_alloc_int(int value) {
void *data_copy = util_alloc_copy(&value, sizeof value);
return node_data_alloc__(data_copy, CTYPE_INT_VALUE, sizeof value, NULL,
Expand Down

0 comments on commit 6411af8

Please sign in to comment.