[core] remove unused array_reset()

personal/stbuehler/ci-build
Glenn Strauss 2019-10-03 08:25:51 -04:00
parent 785037dded
commit ddb78f75ee
8 changed files with 1 additions and 60 deletions

View File

@ -66,18 +66,6 @@ void array_free(array * const a) {
free(a);
}
void array_reset(array * const a) {
if (!a) return;
data_unset ** const data = a->data;
const uint32_t used = a->used;
a->used = 0;
for (uint32_t i = 0; i < used; ++i) {
data[i]->fn->reset(data[i]);
data[i]->is_index_key = 0;
}
}
void array_reset_data_strings(array * const a) {
if (!a) return;

View File

@ -7,7 +7,6 @@
struct data_unset; /* declaration */
struct data_methods {
void (*reset)(struct data_unset *p); \
struct data_unset *(*copy)(const struct data_unset *src); \
void (*free)(struct data_unset *p); \
int (*insert_dup)(struct data_unset *dst, struct data_unset *src); \
@ -64,9 +63,6 @@ array *array_init_array(const array *a);
void array_free(array *a);
__attribute_cold__
void array_reset(array *a);
__attribute_hot__
void array_reset_data_strings(array *a);

View File

@ -25,15 +25,6 @@ static void data_array_free(data_unset *d) {
free(d);
}
__attribute_cold__
static void data_array_reset(data_unset *d) {
data_array *ds = (data_array *)d;
/* reused array elements */
buffer_reset(ds->key);
array_reset(ds->value);
}
__attribute_cold__
static int data_array_insert_dup(data_unset *dst, data_unset *src) {
UNUSED(dst);
@ -52,7 +43,6 @@ static void data_array_print(const data_unset *d, int depth) {
data_array *data_array_init(void) {
static const struct data_methods fn = {
data_array_reset,
data_array_copy,
data_array_free,
data_array_insert_dup,

View File

@ -47,17 +47,6 @@ static void data_config_free(data_unset *d) {
free(d);
}
__attribute_cold__
static void data_config_reset(data_unset *d) {
data_config *ds = (data_config *)d;
/* reused array elements */
buffer_clear(ds->key);
buffer_clear(ds->comp_tag);
buffer_clear(ds->comp_key);
array_reset(ds->value);
}
__attribute_cold__
static int data_config_insert_dup(data_unset *dst, data_unset *src) {
UNUSED(dst);
@ -140,7 +129,6 @@ static void data_config_print(const data_unset *d, int depth) {
data_config *data_config_init(void) {
static const struct data_methods fn = {
data_config_reset,
data_config_copy,
data_config_free,
data_config_insert_dup,

View File

@ -24,15 +24,6 @@ static void data_integer_free(data_unset *d) {
free(d);
}
__attribute_cold__
static void data_integer_reset(data_unset *d) {
data_integer *ds = (data_integer *)d;
/* reused integer elements */
buffer_clear(ds->key);
ds->value = 0;
}
__attribute_cold__
static int data_integer_insert_dup(data_unset *dst, data_unset *src) {
UNUSED(dst);
@ -53,7 +44,6 @@ static void data_integer_print(const data_unset *d, int depth) {
data_integer *data_integer_init(void) {
static const struct data_methods fn = {
data_integer_reset,
data_integer_copy,
data_integer_free,
data_integer_insert_dup,

View File

@ -25,15 +25,6 @@ static void data_string_free(data_unset *d) {
free(d);
}
__attribute_cold__
static void data_string_reset(data_unset *d) {
data_string *ds = (data_string *)d;
/* reused array elements */
buffer_reset(ds->key);
buffer_reset(ds->value);
}
__attribute_cold__
static int data_string_insert_dup(data_unset *dst, data_unset *src) {
data_string *ds_dst = (data_string *)dst;
@ -80,7 +71,6 @@ static void data_string_print(const data_unset *d, int depth) {
data_string *data_string_init(void) {
static const struct data_methods fn = {
data_string_reset,
data_string_copy,
data_string_free,
data_string_insert_dup,

View File

@ -101,7 +101,6 @@ static void data_auth_free(data_unset *d)
static data_auth *data_auth_init(void)
{
static const struct data_methods fn = {
NULL, /* reset must not be called on this data */
NULL, /* copy must not be called on this data */
data_auth_free,
NULL, /* insert_dup must not be called on this data */

View File

@ -24,7 +24,7 @@ static void test_request_connection_reset(connection *con)
buffer_reset(con->request.request);
buffer_reset(con->request.orig_uri);
buffer_reset(con->request.uri);
array_reset(con->request.headers);
array_reset_data_strings(con->request.headers);
}
static void run_http_request_parse(connection *con, int line, int status, const char *desc, const char *req, size_t reqlen)