summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/lhash/lhash.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/lhash/lhash.c')
-rw-r--r--src/lib/libcrypto/lhash/lhash.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/lib/libcrypto/lhash/lhash.c b/src/lib/libcrypto/lhash/lhash.c
index 0a16fcf27d..04ea80203c 100644
--- a/src/lib/libcrypto/lhash/lhash.c
+++ b/src/lib/libcrypto/lhash/lhash.c
@@ -100,7 +100,7 @@
100#include <openssl/crypto.h> 100#include <openssl/crypto.h>
101#include <openssl/lhash.h> 101#include <openssl/lhash.h>
102 102
103const char *lh_version="lhash" OPENSSL_VERSION_PTEXT; 103const char lh_version[]="lhash" OPENSSL_VERSION_PTEXT;
104 104
105#undef MIN_NODES 105#undef MIN_NODES
106#define MIN_NODES 16 106#define MIN_NODES 16
@@ -176,11 +176,11 @@ void lh_free(LHASH *lh)
176 OPENSSL_free(lh); 176 OPENSSL_free(lh);
177 } 177 }
178 178
179void *lh_insert(LHASH *lh, const void *data) 179void *lh_insert(LHASH *lh, void *data)
180 { 180 {
181 unsigned long hash; 181 unsigned long hash;
182 LHASH_NODE *nn,**rn; 182 LHASH_NODE *nn,**rn;
183 const void *ret; 183 void *ret;
184 184
185 lh->error=0; 185 lh->error=0;
186 if (lh->up_load <= (lh->num_items*LH_LOAD_MULT/lh->num_nodes)) 186 if (lh->up_load <= (lh->num_items*LH_LOAD_MULT/lh->num_nodes))
@@ -211,14 +211,14 @@ void *lh_insert(LHASH *lh, const void *data)
211 (*rn)->data=data; 211 (*rn)->data=data;
212 lh->num_replace++; 212 lh->num_replace++;
213 } 213 }
214 return((void *)ret); 214 return(ret);
215 } 215 }
216 216
217void *lh_delete(LHASH *lh, const void *data) 217void *lh_delete(LHASH *lh, const void *data)
218 { 218 {
219 unsigned long hash; 219 unsigned long hash;
220 LHASH_NODE *nn,**rn; 220 LHASH_NODE *nn,**rn;
221 const void *ret; 221 void *ret;
222 222
223 lh->error=0; 223 lh->error=0;
224 rn=getrn(lh,data,&hash); 224 rn=getrn(lh,data,&hash);
@@ -242,14 +242,14 @@ void *lh_delete(LHASH *lh, const void *data)
242 (lh->down_load >= (lh->num_items*LH_LOAD_MULT/lh->num_nodes))) 242 (lh->down_load >= (lh->num_items*LH_LOAD_MULT/lh->num_nodes)))
243 contract(lh); 243 contract(lh);
244 244
245 return((void *)ret); 245 return(ret);
246 } 246 }
247 247
248void *lh_retrieve(LHASH *lh, const void *data) 248void *lh_retrieve(LHASH *lh, const void *data)
249 { 249 {
250 unsigned long hash; 250 unsigned long hash;
251 LHASH_NODE **rn; 251 LHASH_NODE **rn;
252 const void *ret; 252 void *ret;
253 253
254 lh->error=0; 254 lh->error=0;
255 rn=getrn(lh,data,&hash); 255 rn=getrn(lh,data,&hash);
@@ -264,7 +264,7 @@ void *lh_retrieve(LHASH *lh, const void *data)
264 ret= (*rn)->data; 264 ret= (*rn)->data;
265 lh->num_retrieve++; 265 lh->num_retrieve++;
266 } 266 }
267 return((void *)ret); 267 return(ret);
268 } 268 }
269 269
270static void doall_util_fn(LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func, 270static void doall_util_fn(LHASH *lh, int use_arg, LHASH_DOALL_FN_TYPE func,
@@ -339,7 +339,7 @@ static void expand(LHASH *lh)
339 { 339 {
340 j=(int)lh->num_alloc_nodes*2; 340 j=(int)lh->num_alloc_nodes*2;
341 n=(LHASH_NODE **)OPENSSL_realloc(lh->b, 341 n=(LHASH_NODE **)OPENSSL_realloc(lh->b,
342 (unsigned int)sizeof(LHASH_NODE *)*j); 342 (int)(sizeof(LHASH_NODE *)*j));
343 if (n == NULL) 343 if (n == NULL)
344 { 344 {
345/* fputs("realloc error in lhash",stderr); */ 345/* fputs("realloc error in lhash",stderr); */
@@ -401,7 +401,7 @@ static LHASH_NODE **getrn(LHASH *lh, const void *data, unsigned long *rhash)
401 { 401 {
402 LHASH_NODE **ret,*n1; 402 LHASH_NODE **ret,*n1;
403 unsigned long hash,nn; 403 unsigned long hash,nn;
404 int (*cf)(); 404 LHASH_COMP_FN_TYPE cf;
405 405
406 hash=(*(lh->hash))(data); 406 hash=(*(lh->hash))(data);
407 lh->num_hash_calls++; 407 lh->num_hash_calls++;