From 7971152742f624f647f8e4f64e55fa49bce3eb21 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Wed, 19 Aug 2015 16:15:26 +0200 Subject: [PATCH] Make all private functions static --- src/context.c | 8 ++++---- src/dict.c | 6 +++--- src/list.c | 2 +- src/sync.c | 6 ------ 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/context.c b/src/context.c index 2faabfe0..48c15b83 100644 --- a/src/context.c +++ b/src/context.c @@ -92,8 +92,8 @@ getdns_port_str_array[] = { }; /* Private functions */ -getdns_return_t create_default_namespaces(struct getdns_context *context); -getdns_return_t create_default_dns_transports(struct getdns_context *context); +static getdns_return_t create_default_namespaces(struct getdns_context *context); +static getdns_return_t create_default_dns_transports(struct getdns_context *context); static struct getdns_list *create_default_root_servers(void); static getdns_return_t set_os_defaults(struct getdns_context *); static int transaction_id_cmp(const void *, const void *); @@ -130,7 +130,7 @@ static void destroy_local_host(_getdns_rbnode_t * node, void *arg) * Helper to get default lookup namespaces. * TODO: Determine from OS */ -getdns_return_t +static getdns_return_t create_default_namespaces(struct getdns_context *context) { context->namespaces = GETDNS_XMALLOC(context->my_mf, getdns_namespace_t, 2); @@ -147,7 +147,7 @@ create_default_namespaces(struct getdns_context *context) /** * Helper to get default transports. */ -getdns_return_t +static getdns_return_t create_default_dns_transports(struct getdns_context *context) { context->dns_transports = GETDNS_XMALLOC(context->my_mf, getdns_transport_list_t, 2); diff --git a/src/dict.c b/src/dict.c index 61a30fa1..f74cb2b6 100644 --- a/src/dict.c +++ b/src/dict.c @@ -56,14 +56,14 @@ * @return pointer to dictionary item, caller must not free storage associated with item * @return NULL if additnotfnd == FALSE and key is not in dictionary */ -struct getdns_dict_item * +static struct getdns_dict_item * getdns_dict_find(const struct getdns_dict *dict, const char *key) { return (struct getdns_dict_item *) _getdns_rbtree_search((_getdns_rbtree_t *)&(dict->root), key); } /* getdns_dict_find */ -struct getdns_dict_item * +static struct getdns_dict_item * getdns_dict_find_and_add(struct getdns_dict *dict, const char *key) { struct getdns_dict_item *item; @@ -345,7 +345,7 @@ getdns_dict_copy(const struct getdns_dict * srcdict, * to free the items * @return void */ -void +static void getdns_dict_item_free(_getdns_rbnode_t * node, void *arg) { struct getdns_dict_item *item = (struct getdns_dict_item *) node; diff --git a/src/list.c b/src/list.c index 896df4ad..f3611685 100644 --- a/src/list.c +++ b/src/list.c @@ -146,7 +146,7 @@ getdns_list_get_int(const struct getdns_list * list, size_t index, * in case of an error the list should be considered unusable * @return GETDNS_RETURN_GOOD on success, GETDNS_RETURN_GENERIC_ERROR if out of memory */ -getdns_return_t +static getdns_return_t getdns_list_realloc(struct getdns_list *list) { struct getdns_list_item *newlist; diff --git a/src/sync.c b/src/sync.c index 4632a4fa..ca643548 100644 --- a/src/sync.c +++ b/src/sync.c @@ -218,10 +218,4 @@ getdns_service_sync(getdns_context *context, const char *name, GETDNS_RETURN_GOOD : GETDNS_RETURN_GENERIC_ERROR; } -void -getdns_free_sync_request_memory(struct getdns_dict *response) -{ - getdns_dict_destroy(response); -} - /* getdns_core_sync.c */