BN_mod_sqrt documentation/comment
[openssl.git] / crypto / mem_dbg.c
index fb8f3759a456b4f94028decc49f48df466bebdc7..56ce7dddea60d1d03a433d30590e1776c00613f8 100644 (file)
@@ -234,6 +234,9 @@ static unsigned long mem_hash(MEM *a)
        return(ret);
        }
 
+static IMPLEMENT_LHASH_HASH_FN(mem_hash, MEM *)
+static IMPLEMENT_LHASH_COMP_FN(mem_cmp, MEM *)
+
 static int app_info_cmp(APP_INFO *a, APP_INFO *b)
        {
        return(a->thread != b->thread);
@@ -249,7 +252,10 @@ static unsigned long app_info_hash(APP_INFO *a)
        return(ret);
        }
 
-static APP_INFO *pop_info()
+static IMPLEMENT_LHASH_HASH_FN(app_info_hash, APP_INFO *)
+static IMPLEMENT_LHASH_COMP_FN(app_info_cmp, APP_INFO *)
+
+static APP_INFO *pop_info(void)
        {
        APP_INFO tmp;
        APP_INFO *ret = NULL;
@@ -302,7 +308,8 @@ int CRYPTO_push_info_(const char *info, const char *file, int line)
                        }
                if (amih == NULL)
                        {
-                       if ((amih=lh_new(app_info_hash,app_info_cmp)) == NULL)
+                       if ((amih=lh_new(LHASH_HASH_FN(app_info_hash),
+                                       LHASH_COMP_FN(app_info_cmp))) == NULL)
                                {
                                OPENSSL_free(ami);
                                ret=0;
@@ -394,7 +401,8 @@ void CRYPTO_dbg_malloc(void *addr, int num, const char *file, int line,
                                }
                        if (mh == NULL)
                                {
-                               if ((mh=lh_new(mem_hash,mem_cmp)) == NULL)
+                               if ((mh=lh_new(LHASH_HASH_FN(mem_hash),
+                                       LHASH_COMP_FN(mem_cmp))) == NULL)
                                        {
                                        OPENSSL_free(addr);
                                        OPENSSL_free(m);
@@ -647,7 +655,8 @@ void CRYPTO_mem_leaks(BIO *b)
        ml.chunks=0;
        MemCheck_off(); /* obtains CRYPTO_LOCK_MALLOC2 */
        if (mh != NULL)
-               lh_doall_arg(mh,(void (*)())print_leak,(char *)&ml);
+               lh_doall_arg(mh, (LHASH_DOALL_ARG_FN_TYPE)print_leak,
+                               (char *)&ml);
        if (ml.chunks != 0)
                {
                sprintf(buf,"%ld bytes leaked in %d chunks\n",
@@ -725,6 +734,6 @@ void CRYPTO_mem_leaks_cb(void (*cb)(unsigned long, const char *, int, int, void
        {
        if (mh == NULL) return;
        CRYPTO_w_lock(CRYPTO_LOCK_MALLOC2);
-       lh_doall_arg(mh,(void (*)())cb_leak,(void *)&cb);
+       lh_doall_arg(mh, (LHASH_DOALL_ARG_FN_TYPE)cb_leak,(void *)&cb);
        CRYPTO_w_unlock(CRYPTO_LOCK_MALLOC2);
        }