Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused node_data c functions #997

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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