Changes between 0.9.6 and 0.9.7 [xx XXX 2000]
+ *) Finish off removing the remaining LHASH function pointer casts.
+ There should no longer be any prototype-casting required when using
+ the LHASH abstraction, and any casts that remain are "bugs".
+ [Geoff Thorpe]
+
*) Change the Unix RAND_poll() variant to be able to poll several
random devices and only read data for a small fragment of time
to avoid hangs. Also separate out the Unix variant to it's own
#include <stdio.h>
#include <openssl/conf.h>
-void print_conf(CONF_VALUE *cv);
+static void print_conf(CONF_VALUE *cv);
+static IMPLEMENT_LHASH_DOALL_FN(print_conf, CONF_VALUE *);
main()
{
exit(1);
}
- lh_doall(conf,(LHASH_DOALL_FN_TYPE)print_conf);
+ lh_doall(conf,LHASH_DOALL_FN(print_conf));
}
-void print_conf(CONF_VALUE *cv)
+static void print_conf(CONF_VALUE *cv)
{
int i;
CONF_VALUE *v;
static void value_free_hash(CONF_VALUE *a, LHASH *conf);
static void value_free_stack(CONF_VALUE *a,LHASH *conf);
+static IMPLEMENT_LHASH_DOALL_ARG_FN(value_free_hash, CONF_VALUE *, LHASH *)
+static IMPLEMENT_LHASH_DOALL_ARG_FN(value_free_stack, CONF_VALUE *, LHASH *)
/* We don't use function pointer casting or wrapper functions - but cast each
* callback parameter inside the callback functions. */
/* static unsigned long hash(CONF_VALUE *v); */
conf->data->down_load=0; /* evil thing to make sure the 'OPENSSL_free()'
* works as expected */
- lh_doall_arg(conf->data, (LHASH_DOALL_ARG_FN_TYPE)value_free_hash,
+ lh_doall_arg(conf->data, LHASH_DOALL_ARG_FN(value_free_hash),
conf->data);
/* We now have only 'section' entries in the hash table.
* Due to problems with */
- lh_doall_arg(conf->data, (LHASH_DOALL_ARG_FN_TYPE)value_free_stack,
+ lh_doall_arg(conf->data, LHASH_DOALL_ARG_FN(value_free_stack),
conf->data);
lh_free(conf->data);
}
BIO_printf(out, "[[%s]]\n", a->section);
}
+static IMPLEMENT_LHASH_DOALL_ARG_FN(dump_value, CONF_VALUE *, BIO *)
+
static int def_dump(CONF *conf, BIO *out)
{
- lh_doall_arg(conf->data, (LHASH_DOALL_ARG_FN_TYPE)dump_value, out);
+ lh_doall_arg(conf->data, LHASH_DOALL_ARG_FN(dump_value), out);
return 1;
}
d->fn(name,d->arg);
}
+static IMPLEMENT_LHASH_DOALL_ARG_FN(do_all_fn, const OBJ_NAME *, struct doall *)
+
void OBJ_NAME_do_all(int type,void (*fn)(const OBJ_NAME *,void *arg),void *arg)
{
struct doall d;
d.fn=fn;
d.arg=arg;
- lh_doall_arg(names_lh,(LHASH_DOALL_ARG_FN_TYPE)do_all_fn,&d);
+ lh_doall_arg(names_lh,LHASH_DOALL_ARG_FN(do_all_fn),&d);
}
struct doall_sorted
}
}
+static IMPLEMENT_LHASH_DOALL_FN(names_lh_free, OBJ_NAME *)
+
static void name_funcs_free(NAME_FUNCS *ptr)
{
OPENSSL_free(ptr);
down_load=names_lh->down_load;
names_lh->down_load=0;
- lh_doall(names_lh,(LHASH_DOALL_FN_TYPE)names_lh_free);
+ lh_doall(names_lh,LHASH_DOALL_FN(names_lh_free));
if (type < 0)
{
lh_free(names_lh);
OPENSSL_free(a);
}
+static IMPLEMENT_LHASH_DOALL_FN(cleanup1, ADDED_OBJ *)
+static IMPLEMENT_LHASH_DOALL_FN(cleanup2, ADDED_OBJ *)
+static IMPLEMENT_LHASH_DOALL_FN(cleanup3, ADDED_OBJ *)
+
void OBJ_cleanup(void)
{
if (added == NULL) return;
added->down_load=0;
- lh_doall(added,(LHASH_DOALL_FN_TYPE)cleanup1); /* zero counters */
- lh_doall(added,(LHASH_DOALL_FN_TYPE)cleanup2); /* set counters */
- lh_doall(added,(LHASH_DOALL_FN_TYPE)cleanup3); /* free objects */
+ lh_doall(added,LHASH_DOALL_FN(cleanup1)); /* zero counters */
+ lh_doall(added,LHASH_DOALL_FN(cleanup2)); /* set counters */
+ lh_doall(added,LHASH_DOALL_FN(cleanup3)); /* free objects */
lh_free(added);
added=NULL;
}
}
}
+static IMPLEMENT_LHASH_DOALL_ARG_FN(timeout, SSL_SESSION *, TIMEOUT_PARAM *)
+
void SSL_CTX_flush_sessions(SSL_CTX *s, long t)
{
unsigned long i;
CRYPTO_w_lock(CRYPTO_LOCK_SSL_CTX);
i=tp.cache->down_load;
tp.cache->down_load=0;
- lh_doall_arg(tp.cache, (LHASH_DOALL_ARG_FN_TYPE)timeout, &tp);
+ lh_doall_arg(tp.cache, LHASH_DOALL_ARG_FN(timeout), &tp);
tp.cache->down_load=i;
CRYPTO_w_unlock(CRYPTO_LOCK_SSL_CTX);
}