diff options
author | Andreas Steffen <andreas.steffen@strongswan.org> | 2010-12-04 20:43:41 +0100 |
---|---|---|
committer | Andreas Steffen <andreas.steffen@strongswan.org> | 2010-12-04 20:43:41 +0100 |
commit | e5e79bd4036dd53418e43df7c2371a4761f1f1ec (patch) | |
tree | 488b020647011c46f7f53001a2403b793e7e2e53 | |
parent | 1e84aa74aaaf1f32f97661febe86c8bfab72a7fb (diff) | |
download | strongswan-e5e79bd4036dd53418e43df7c2371a4761f1f1ec.tar.bz2 strongswan-e5e79bd4036dd53418e43df7c2371a4761f1f1ec.tar.xz |
Migrated md5_plugin_t to INIT/METHOD macros
-rw-r--r-- | src/libstrongswan/plugins/md5/md5_plugin.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/libstrongswan/plugins/md5/md5_plugin.c b/src/libstrongswan/plugins/md5/md5_plugin.c index cfbf6acea..ad8f090dc 100644 --- a/src/libstrongswan/plugins/md5/md5_plugin.c +++ b/src/libstrongswan/plugins/md5/md5_plugin.c @@ -31,10 +31,8 @@ struct private_md5_plugin_t { md5_plugin_t public; }; -/** - * Implementation of md5_plugin_t.destroy - */ -static void destroy(private_md5_plugin_t *this) +METHOD(plugin_t, destroy, void, + private_md5_plugin_t *this) { lib->crypto->remove_hasher(lib->crypto, (hasher_constructor_t)md5_hasher_create); @@ -46,9 +44,15 @@ static void destroy(private_md5_plugin_t *this) */ plugin_t *md5_plugin_create() { - private_md5_plugin_t *this = malloc_thing(private_md5_plugin_t); - - this->public.plugin.destroy = (void(*)(plugin_t*))destroy; + private_md5_plugin_t *this; + + INIT(this, + .public = { + .plugin = { + .destroy = _destroy, + }, + }, + ); lib->crypto->add_hasher(lib->crypto, HASH_MD5, (hasher_constructor_t)md5_hasher_create); |