Loading apps/openssl.c +1 −5 Original line number Diff line number Diff line Loading @@ -700,15 +700,11 @@ static int function_cmp(const FUNCTION * a, const FUNCTION * b) return strncmp(a->name, b->name, 8); } static IMPLEMENT_LHASH_COMP_FN(function, FUNCTION) static unsigned long function_hash(const FUNCTION * a) { return lh_strhash(a->name); } static IMPLEMENT_LHASH_HASH_FN(function, FUNCTION) static int SortFnByName(const void *_f1, const void *_f2) { const FUNCTION *f1 = _f1; Loading Loading @@ -860,7 +856,7 @@ static LHASH_OF(FUNCTION) *prog_init(void) for (i = 0, f = functions; f->name != NULL; ++f, ++i) ; qsort(functions, i, sizeof(*functions), SortFnByName); if ((ret = lh_FUNCTION_new()) == NULL) if ((ret = lh_FUNCTION_new(function_hash, function_cmp)) == NULL) return (NULL); for (f = functions; f->name != NULL; f++) Loading crypto/conf/conf_api.c +4 −7 Original line number Diff line number Diff line Loading @@ -162,8 +162,6 @@ static unsigned long conf_value_hash(const CONF_VALUE *v) return (lh_strhash(v->section) << 2) ^ lh_strhash(v->name); } static IMPLEMENT_LHASH_HASH_FN(conf_value, CONF_VALUE) static int conf_value_cmp(const CONF_VALUE *a, const CONF_VALUE *b) { int i; Loading @@ -183,15 +181,14 @@ static int conf_value_cmp(const CONF_VALUE *a, const CONF_VALUE *b) return ((a->name == NULL) ? -1 : 1); } static IMPLEMENT_LHASH_COMP_FN(conf_value, CONF_VALUE) int _CONF_new_data(CONF *conf) { if (conf == NULL) { return 0; } if (conf->data == NULL) { conf->data = lh_CONF_VALUE_new(conf_value_hash, conf_value_cmp); if (conf->data == NULL) if ((conf->data = lh_CONF_VALUE_new()) == NULL) { return 0; } return 1; Loading crypto/engine/eng_table.c +1 −4 Original line number Diff line number Diff line Loading @@ -106,9 +106,6 @@ static int engine_pile_cmp(const ENGINE_PILE *a, const ENGINE_PILE *b) return a->nid - b->nid; } static IMPLEMENT_LHASH_HASH_FN(engine_pile, ENGINE_PILE) static IMPLEMENT_LHASH_COMP_FN(engine_pile, ENGINE_PILE) static int int_table_check(ENGINE_TABLE **t, int create) { LHASH_OF(ENGINE_PILE) *lh; Loading @@ -117,7 +114,7 @@ static int int_table_check(ENGINE_TABLE **t, int create) return 1; if (!create) return 0; if ((lh = lh_ENGINE_PILE_new()) == NULL) if ((lh = lh_ENGINE_PILE_new(engine_pile_hash, engine_pile_cmp)) == NULL) return 0; *t = (ENGINE_TABLE *)lh; return 1; Loading crypto/err/err.c +3 −15 Original line number Diff line number Diff line Loading @@ -240,11 +240,6 @@ static LHASH_OF(ERR_STATE) *int_thread_hash = NULL; static int int_thread_hash_references = 0; static int int_err_library_number = ERR_LIB_USER; /* * These are the callbacks provided to "lh_new()" when creating the LHASH * tables internal to the "err_defaults" implementation. */ static unsigned long get_error_values(int inc, int top, const char **file, int *line, const char **data, int *flags); Loading @@ -258,16 +253,12 @@ static unsigned long err_string_data_hash(const ERR_STRING_DATA *a) return (ret ^ ret % 19 * 13); } static IMPLEMENT_LHASH_HASH_FN(err_string_data, ERR_STRING_DATA) static int err_string_data_cmp(const ERR_STRING_DATA *a, const ERR_STRING_DATA *b) { return (int)(a->error - b->error); } static IMPLEMENT_LHASH_COMP_FN(err_string_data, ERR_STRING_DATA) static LHASH_OF(ERR_STRING_DATA) *get_hash(int create, int lockit) { LHASH_OF(ERR_STRING_DATA) *ret = NULL; Loading @@ -275,7 +266,8 @@ static LHASH_OF(ERR_STRING_DATA) *get_hash(int create, int lockit) if (lockit) CRYPTO_w_lock(CRYPTO_LOCK_ERR); if (!int_error_hash && create) { int_error_hash = lh_ERR_STRING_DATA_new(); int_error_hash = lh_ERR_STRING_DATA_new(err_string_data_hash, err_string_data_cmp); } if (int_error_hash != NULL) ret = int_error_hash; Loading Loading @@ -304,15 +296,11 @@ static unsigned long err_state_hash(const ERR_STATE *a) return CRYPTO_THREADID_hash(&a->tid) * 13; } static IMPLEMENT_LHASH_HASH_FN(err_state, ERR_STATE) static int err_state_cmp(const ERR_STATE *a, const ERR_STATE *b) { return CRYPTO_THREADID_cmp(&a->tid, &b->tid); } static IMPLEMENT_LHASH_COMP_FN(err_state, ERR_STATE) static LHASH_OF(ERR_STATE) *int_thread_get(int create, int lockit) { LHASH_OF(ERR_STATE) *ret = NULL; Loading @@ -320,7 +308,7 @@ static LHASH_OF(ERR_STATE) *int_thread_get(int create, int lockit) if (lockit) CRYPTO_w_lock(CRYPTO_LOCK_ERR); if (!int_thread_hash && create) { int_thread_hash = lh_ERR_STATE_new(); int_thread_hash = lh_ERR_STATE_new(err_state_hash, err_state_cmp); } if (int_thread_hash != NULL) { int_thread_hash_references++; Loading crypto/mem_dbg.c +4 −14 Original line number Diff line number Diff line Loading @@ -306,8 +306,6 @@ static int mem_cmp(const MEM *a, const MEM *b) #endif } static IMPLEMENT_LHASH_COMP_FN(mem, MEM) static unsigned long mem_hash(const MEM *a) { size_t ret; Loading @@ -318,17 +316,11 @@ static unsigned long mem_hash(const MEM *a) return (ret); } static IMPLEMENT_LHASH_HASH_FN(mem, MEM) /* static int app_info_cmp(APP_INFO *a, APP_INFO *b) */ static int app_info_cmp(const void *a_void, const void *b_void) static int app_info_cmp(const APP_INFO *a, const APP_INFO *b) { return CRYPTO_THREADID_cmp(&((const APP_INFO *)a_void)->threadid, &((const APP_INFO *)b_void)->threadid); return CRYPTO_THREADID_cmp(&a->threadid, &b->threadid); } static IMPLEMENT_LHASH_COMP_FN(app_info, APP_INFO) static unsigned long app_info_hash(const APP_INFO *a) { unsigned long ret; Loading @@ -339,8 +331,6 @@ static unsigned long app_info_hash(const APP_INFO *a) return (ret); } static IMPLEMENT_LHASH_HASH_FN(app_info, APP_INFO) static APP_INFO *pop_info(void) { APP_INFO tmp; Loading Loading @@ -377,7 +367,7 @@ int CRYPTO_mem_debug_push(const char *info, const char *file, int line) if ((ami = OPENSSL_malloc(sizeof(*ami))) == NULL) goto err; if (amih == NULL) { if ((amih = lh_APP_INFO_new()) == NULL) { if ((amih = lh_APP_INFO_new(app_info_hash, app_info_cmp)) == NULL) { OPENSSL_free(ami); goto err; } Loading Loading @@ -435,7 +425,7 @@ void CRYPTO_mem_debug_malloc(void *addr, size_t num, int before_p, return; } if (mh == NULL) { if ((mh = lh_MEM_new()) == NULL) { if ((mh = lh_MEM_new(mem_hash, mem_cmp)) == NULL) { OPENSSL_free(addr); OPENSSL_free(m); addr = NULL; Loading Loading
apps/openssl.c +1 −5 Original line number Diff line number Diff line Loading @@ -700,15 +700,11 @@ static int function_cmp(const FUNCTION * a, const FUNCTION * b) return strncmp(a->name, b->name, 8); } static IMPLEMENT_LHASH_COMP_FN(function, FUNCTION) static unsigned long function_hash(const FUNCTION * a) { return lh_strhash(a->name); } static IMPLEMENT_LHASH_HASH_FN(function, FUNCTION) static int SortFnByName(const void *_f1, const void *_f2) { const FUNCTION *f1 = _f1; Loading Loading @@ -860,7 +856,7 @@ static LHASH_OF(FUNCTION) *prog_init(void) for (i = 0, f = functions; f->name != NULL; ++f, ++i) ; qsort(functions, i, sizeof(*functions), SortFnByName); if ((ret = lh_FUNCTION_new()) == NULL) if ((ret = lh_FUNCTION_new(function_hash, function_cmp)) == NULL) return (NULL); for (f = functions; f->name != NULL; f++) Loading
crypto/conf/conf_api.c +4 −7 Original line number Diff line number Diff line Loading @@ -162,8 +162,6 @@ static unsigned long conf_value_hash(const CONF_VALUE *v) return (lh_strhash(v->section) << 2) ^ lh_strhash(v->name); } static IMPLEMENT_LHASH_HASH_FN(conf_value, CONF_VALUE) static int conf_value_cmp(const CONF_VALUE *a, const CONF_VALUE *b) { int i; Loading @@ -183,15 +181,14 @@ static int conf_value_cmp(const CONF_VALUE *a, const CONF_VALUE *b) return ((a->name == NULL) ? -1 : 1); } static IMPLEMENT_LHASH_COMP_FN(conf_value, CONF_VALUE) int _CONF_new_data(CONF *conf) { if (conf == NULL) { return 0; } if (conf->data == NULL) { conf->data = lh_CONF_VALUE_new(conf_value_hash, conf_value_cmp); if (conf->data == NULL) if ((conf->data = lh_CONF_VALUE_new()) == NULL) { return 0; } return 1; Loading
crypto/engine/eng_table.c +1 −4 Original line number Diff line number Diff line Loading @@ -106,9 +106,6 @@ static int engine_pile_cmp(const ENGINE_PILE *a, const ENGINE_PILE *b) return a->nid - b->nid; } static IMPLEMENT_LHASH_HASH_FN(engine_pile, ENGINE_PILE) static IMPLEMENT_LHASH_COMP_FN(engine_pile, ENGINE_PILE) static int int_table_check(ENGINE_TABLE **t, int create) { LHASH_OF(ENGINE_PILE) *lh; Loading @@ -117,7 +114,7 @@ static int int_table_check(ENGINE_TABLE **t, int create) return 1; if (!create) return 0; if ((lh = lh_ENGINE_PILE_new()) == NULL) if ((lh = lh_ENGINE_PILE_new(engine_pile_hash, engine_pile_cmp)) == NULL) return 0; *t = (ENGINE_TABLE *)lh; return 1; Loading
crypto/err/err.c +3 −15 Original line number Diff line number Diff line Loading @@ -240,11 +240,6 @@ static LHASH_OF(ERR_STATE) *int_thread_hash = NULL; static int int_thread_hash_references = 0; static int int_err_library_number = ERR_LIB_USER; /* * These are the callbacks provided to "lh_new()" when creating the LHASH * tables internal to the "err_defaults" implementation. */ static unsigned long get_error_values(int inc, int top, const char **file, int *line, const char **data, int *flags); Loading @@ -258,16 +253,12 @@ static unsigned long err_string_data_hash(const ERR_STRING_DATA *a) return (ret ^ ret % 19 * 13); } static IMPLEMENT_LHASH_HASH_FN(err_string_data, ERR_STRING_DATA) static int err_string_data_cmp(const ERR_STRING_DATA *a, const ERR_STRING_DATA *b) { return (int)(a->error - b->error); } static IMPLEMENT_LHASH_COMP_FN(err_string_data, ERR_STRING_DATA) static LHASH_OF(ERR_STRING_DATA) *get_hash(int create, int lockit) { LHASH_OF(ERR_STRING_DATA) *ret = NULL; Loading @@ -275,7 +266,8 @@ static LHASH_OF(ERR_STRING_DATA) *get_hash(int create, int lockit) if (lockit) CRYPTO_w_lock(CRYPTO_LOCK_ERR); if (!int_error_hash && create) { int_error_hash = lh_ERR_STRING_DATA_new(); int_error_hash = lh_ERR_STRING_DATA_new(err_string_data_hash, err_string_data_cmp); } if (int_error_hash != NULL) ret = int_error_hash; Loading Loading @@ -304,15 +296,11 @@ static unsigned long err_state_hash(const ERR_STATE *a) return CRYPTO_THREADID_hash(&a->tid) * 13; } static IMPLEMENT_LHASH_HASH_FN(err_state, ERR_STATE) static int err_state_cmp(const ERR_STATE *a, const ERR_STATE *b) { return CRYPTO_THREADID_cmp(&a->tid, &b->tid); } static IMPLEMENT_LHASH_COMP_FN(err_state, ERR_STATE) static LHASH_OF(ERR_STATE) *int_thread_get(int create, int lockit) { LHASH_OF(ERR_STATE) *ret = NULL; Loading @@ -320,7 +308,7 @@ static LHASH_OF(ERR_STATE) *int_thread_get(int create, int lockit) if (lockit) CRYPTO_w_lock(CRYPTO_LOCK_ERR); if (!int_thread_hash && create) { int_thread_hash = lh_ERR_STATE_new(); int_thread_hash = lh_ERR_STATE_new(err_state_hash, err_state_cmp); } if (int_thread_hash != NULL) { int_thread_hash_references++; Loading
crypto/mem_dbg.c +4 −14 Original line number Diff line number Diff line Loading @@ -306,8 +306,6 @@ static int mem_cmp(const MEM *a, const MEM *b) #endif } static IMPLEMENT_LHASH_COMP_FN(mem, MEM) static unsigned long mem_hash(const MEM *a) { size_t ret; Loading @@ -318,17 +316,11 @@ static unsigned long mem_hash(const MEM *a) return (ret); } static IMPLEMENT_LHASH_HASH_FN(mem, MEM) /* static int app_info_cmp(APP_INFO *a, APP_INFO *b) */ static int app_info_cmp(const void *a_void, const void *b_void) static int app_info_cmp(const APP_INFO *a, const APP_INFO *b) { return CRYPTO_THREADID_cmp(&((const APP_INFO *)a_void)->threadid, &((const APP_INFO *)b_void)->threadid); return CRYPTO_THREADID_cmp(&a->threadid, &b->threadid); } static IMPLEMENT_LHASH_COMP_FN(app_info, APP_INFO) static unsigned long app_info_hash(const APP_INFO *a) { unsigned long ret; Loading @@ -339,8 +331,6 @@ static unsigned long app_info_hash(const APP_INFO *a) return (ret); } static IMPLEMENT_LHASH_HASH_FN(app_info, APP_INFO) static APP_INFO *pop_info(void) { APP_INFO tmp; Loading Loading @@ -377,7 +367,7 @@ int CRYPTO_mem_debug_push(const char *info, const char *file, int line) if ((ami = OPENSSL_malloc(sizeof(*ami))) == NULL) goto err; if (amih == NULL) { if ((amih = lh_APP_INFO_new()) == NULL) { if ((amih = lh_APP_INFO_new(app_info_hash, app_info_cmp)) == NULL) { OPENSSL_free(ami); goto err; } Loading Loading @@ -435,7 +425,7 @@ void CRYPTO_mem_debug_malloc(void *addr, size_t num, int before_p, return; } if (mh == NULL) { if ((mh = lh_MEM_new()) == NULL) { if ((mh = lh_MEM_new(mem_hash, mem_cmp)) == NULL) { OPENSSL_free(addr); OPENSSL_free(m); addr = NULL; Loading