From a00ae6c46e0d7907a7c9f9e85334e968aa5fd338 Mon Sep 17 00:00:00 2001 From: Rich Salz Date: Tue, 27 Jan 2015 10:06:22 -0500 Subject: OPENSSL_NO_xxx cleanup: many removals The following compile options (#ifdef's) are removed: OPENSSL_NO_BIO OPENSSL_NO_BUFFER OPENSSL_NO_CHAIN_VERIFY OPENSSL_NO_EVP OPENSSL_NO_FIPS_ERR OPENSSL_NO_HASH_COMP OPENSSL_NO_LHASH OPENSSL_NO_OBJECT OPENSSL_NO_SPEED OPENSSL_NO_STACK OPENSSL_NO_X509 OPENSSL_NO_X509_VERIFY This diff is big because of updating the indents on preprocessor lines. Reviewed-by: Richard Levitte --- crypto/lhash/lh_stats.c | 79 +------------------------------------------------ crypto/lhash/lhash.c | 9 ------ crypto/lhash/lhash.h | 14 +-------- 3 files changed, 2 insertions(+), 100 deletions(-) (limited to 'crypto/lhash') diff --git a/crypto/lhash/lh_stats.c b/crypto/lhash/lh_stats.c index 8b09966097..0a213991d8 100644 --- a/crypto/lhash/lh_stats.c +++ b/crypto/lhash/lh_stats.c @@ -65,78 +65,9 @@ */ #include "cryptlib.h" -#ifndef OPENSSL_NO_BIO -# include -#endif +#include #include -#ifdef OPENSSL_NO_BIO - -void lh_stats(LHASH *lh, FILE *out) -{ - fprintf(out, "num_items = %lu\n", lh->num_items); - fprintf(out, "num_nodes = %u\n", lh->num_nodes); - fprintf(out, "num_alloc_nodes = %u\n", lh->num_alloc_nodes); - fprintf(out, "num_expands = %lu\n", lh->num_expands); - fprintf(out, "num_expand_reallocs = %lu\n", lh->num_expand_reallocs); - fprintf(out, "num_contracts = %lu\n", lh->num_contracts); - fprintf(out, "num_contract_reallocs = %lu\n", lh->num_contract_reallocs); - fprintf(out, "num_hash_calls = %lu\n", lh->num_hash_calls); - fprintf(out, "num_comp_calls = %lu\n", lh->num_comp_calls); - fprintf(out, "num_insert = %lu\n", lh->num_insert); - fprintf(out, "num_replace = %lu\n", lh->num_replace); - fprintf(out, "num_delete = %lu\n", lh->num_delete); - fprintf(out, "num_no_delete = %lu\n", lh->num_no_delete); - fprintf(out, "num_retrieve = %lu\n", lh->num_retrieve); - fprintf(out, "num_retrieve_miss = %lu\n", lh->num_retrieve_miss); - fprintf(out, "num_hash_comps = %lu\n", lh->num_hash_comps); -# if 0 - fprintf(out, "p = %u\n", lh->p); - fprintf(out, "pmax = %u\n", lh->pmax); - fprintf(out, "up_load = %lu\n", lh->up_load); - fprintf(out, "down_load = %lu\n", lh->down_load); -# endif -} - -void lh_node_stats(LHASH *lh, FILE *out) -{ - LHASH_NODE *n; - unsigned int i, num; - - for (i = 0; i < lh->num_nodes; i++) { - for (n = lh->b[i], num = 0; n != NULL; n = n->next) - num++; - fprintf(out, "node %6u -> %3u\n", i, num); - } -} - -void lh_node_usage_stats(LHASH *lh, FILE *out) -{ - LHASH_NODE *n; - unsigned long num; - unsigned int i; - unsigned long total = 0, n_used = 0; - - for (i = 0; i < lh->num_nodes; i++) { - for (n = lh->b[i], num = 0; n != NULL; n = n->next) - num++; - if (num != 0) { - n_used++; - total += num; - } - } - fprintf(out, "%lu nodes used out of %u\n", n_used, lh->num_nodes); - fprintf(out, "%lu items\n", total); - if (n_used == 0) - return; - fprintf(out, "load %d.%02d actual load %d.%02d\n", - (int)(total / lh->num_nodes), - (int)((total % lh->num_nodes) * 100 / lh->num_nodes), - (int)(total / n_used), (int)((total % n_used) * 100 / n_used)); -} - -#else - # ifndef OPENSSL_NO_STDIO void lh_stats(const _LHASH *lh, FILE *fp) { @@ -198,12 +129,6 @@ void lh_stats_bio(const _LHASH *lh, BIO *out) BIO_printf(out, "num_retrieve = %lu\n", lh->num_retrieve); BIO_printf(out, "num_retrieve_miss = %lu\n", lh->num_retrieve_miss); BIO_printf(out, "num_hash_comps = %lu\n", lh->num_hash_comps); -# if 0 - BIO_printf(out, "p = %u\n", lh->p); - BIO_printf(out, "pmax = %u\n", lh->pmax); - BIO_printf(out, "up_load = %lu\n", lh->up_load); - BIO_printf(out, "down_load = %lu\n", lh->down_load); -# endif } void lh_node_stats_bio(const _LHASH *lh, BIO *out) @@ -242,5 +167,3 @@ void lh_node_usage_stats_bio(const _LHASH *lh, BIO *out) (int)((total % lh->num_nodes) * 100 / lh->num_nodes), (int)(total / n_used), (int)((total % n_used) * 100 / n_used)); } - -#endif diff --git a/crypto/lhash/lhash.c b/crypto/lhash/lhash.c index 53c5c138bb..5e9bfb8b1c 100644 --- a/crypto/lhash/lhash.c +++ b/crypto/lhash/lhash.c @@ -194,9 +194,7 @@ void *lh_insert(_LHASH *lh, void *data) } nn->data = data; nn->next = NULL; -#ifndef OPENSSL_NO_HASH_COMP nn->hash = hash; -#endif *rn = nn; ret = NULL; lh->num_insert++; @@ -315,12 +313,7 @@ static void expand(_LHASH *lh) nni = lh->num_alloc_nodes; for (np = *n1; np != NULL;) { -#ifndef OPENSSL_NO_HASH_COMP hash = np->hash; -#else - hash = lh->hash(np->data); - lh->num_hash_calls++; -#endif if ((hash % nni) != p) { /* move it */ *n1 = (*n1)->next; np->next = *n2; @@ -404,13 +397,11 @@ static LHASH_NODE **getrn(_LHASH *lh, const void *data, unsigned long *rhash) cf = lh->comp; ret = &(lh->b[(int)nn]); for (n1 = *ret; n1 != NULL; n1 = n1->next) { -#ifndef OPENSSL_NO_HASH_COMP lh->num_hash_comps++; if (n1->hash != hash) { ret = &(n1->next); continue; } -#endif lh->num_comp_calls++; if (cf(n1->data, data) == 0) break; diff --git a/crypto/lhash/lhash.h b/crypto/lhash/lhash.h index 8ddac6ba28..92ec80af4b 100644 --- a/crypto/lhash/lhash.h +++ b/crypto/lhash/lhash.h @@ -68,9 +68,7 @@ # include # endif -# ifndef OPENSSL_NO_BIO -# include -# endif +# include #ifdef __cplusplus extern "C" { @@ -79,9 +77,7 @@ extern "C" { typedef struct lhash_node_st { void *data; struct lhash_node_st *next; -# ifndef OPENSSL_NO_HASH_COMP unsigned long hash; -# endif } LHASH_NODE; typedef int (*LHASH_COMP_FN_TYPE) (const void *, const void *); @@ -182,17 +178,9 @@ void lh_doall_arg(_LHASH *lh, LHASH_DOALL_ARG_FN_TYPE func, void *arg); unsigned long lh_strhash(const char *c); unsigned long lh_num_items(const _LHASH *lh); -# ifndef OPENSSL_NO_STDIO -void lh_stats(const _LHASH *lh, FILE *out); -void lh_node_stats(const _LHASH *lh, FILE *out); -void lh_node_usage_stats(const _LHASH *lh, FILE *out); -# endif - -# ifndef OPENSSL_NO_BIO void lh_stats_bio(const _LHASH *lh, BIO *out); void lh_node_stats_bio(const _LHASH *lh, BIO *out); void lh_node_usage_stats_bio(const _LHASH *lh, BIO *out); -# endif /* Type checking... */ -- cgit v1.2.3