]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
silence compiler warnings. [RT #20472]
authorMark Andrews <marka@isc.org>
Fri, 30 Oct 2009 05:08:23 +0000 (05:08 +0000)
committerMark Andrews <marka@isc.org>
Fri, 30 Oct 2009 05:08:23 +0000 (05:08 +0000)
lib/dns/openssldh_link.c
lib/dns/openssldsa_link.c
lib/dns/opensslrsa_link.c

index 8773cbf9c3080824ed2c95ad0f70d58aa572d53e..5be3c9c67d8cff3163ffa92f0ac5110c766f9b63 100644 (file)
@@ -31,7 +31,7 @@
 
 /*
  * Principal Author: Brian Wellington
- * $Id: openssldh_link.c,v 1.17 2009/10/24 09:46:19 fdupont Exp $
+ * $Id: openssldh_link.c,v 1.18 2009/10/30 05:08:23 marka Exp $
  */
 
 #ifdef OPENSSL
@@ -153,11 +153,16 @@ openssldh_paramcompare(const dst_key_t *key1, const dst_key_t *key2) {
 static int
 progress_cb(int p, int n, BN_GENCB *cb)
 {
-       void (*callback)(int) = cb->arg;
+       union {
+               void *dptr;
+               void (*fptr)(int);
+       } u;
 
        UNUSED(n);
-       if (callback != NULL)
-               callback(p);
+
+       u.dptr = cb->arg;
+       if (u.fptr != NULL)
+               u.fptr(p);
        return (1);
 }
 #endif
@@ -167,6 +172,10 @@ openssldh_generate(dst_key_t *key, int generator, void (*callback)(int)) {
        DH *dh = NULL;
 #if OPENSSL_VERSION_NUMBER > 0x00908000L
        BN_GENCB cb;
+       union {
+               void *dptr;
+               void (*fptr)(int);
+       } u;
 #else
 
        UNUSED(callback);
@@ -200,7 +209,8 @@ openssldh_generate(dst_key_t *key, int generator, void (*callback)(int)) {
                if (callback == NULL) {
                        BN_GENCB_set_old(&cb, NULL, NULL);
                } else {
-                       BN_GENCB_set(&cb, &progress_cb, callback);
+                       u.fptr = callback;
+                       BN_GENCB_set(&cb, &progress_cb, u.dptr);
                }
 
                if (!DH_generate_parameters_ex(dh, key->key_size, generator,
index e25b27e6bae070e61c44d212b27bba481bc2c1bc..feab1a79065104f308c399ea9c04e29120b3a403 100644 (file)
@@ -29,7 +29,7 @@
  * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: openssldsa_link.c,v 1.17 2009/10/24 09:46:19 fdupont Exp $ */
+/* $Id: openssldsa_link.c,v 1.18 2009/10/30 05:08:23 marka Exp $ */
 
 #ifdef OPENSSL
 #ifndef USE_EVP
@@ -317,11 +317,16 @@ openssldsa_compare(const dst_key_t *key1, const dst_key_t *key2) {
 static int
 progress_cb(int p, int n, BN_GENCB *cb)
 {
-       void (*callback)(int) = cb->arg;
+       union {
+               void *dptr;
+               void (*fptr)(int);
+       } u;
 
        UNUSED(n);
-       if (callback != NULL)
-               callback(p);
+
+       u.dptr = cb->arg;
+       if (u.fptr != NULL)
+               u.fptr(p);
        return (1);
 }
 #endif
@@ -333,8 +338,13 @@ openssldsa_generate(dst_key_t *key, int unused, void (*callback)(int)) {
        isc_result_t result;
 #if OPENSSL_VERSION_NUMBER > 0x00908000L
        BN_GENCB cb;
+       union {
+               void *dptr;
+               void (*fptr)(int);
+       } u;
 
 #else
+
        UNUSED(callback);
 #endif
        UNUSED(unused);
@@ -352,7 +362,8 @@ openssldsa_generate(dst_key_t *key, int unused, void (*callback)(int)) {
        if (callback == NULL) {
                BN_GENCB_set_old(&cb, NULL, NULL);
        } else {
-               BN_GENCB_set(&cb, &progress_cb, callback);
+               u.fptr = callback;
+               BN_GENCB_set(&cb, &progress_cb, u.dptr);
        }
 
        if (!DSA_generate_parameters_ex(dsa, key->key_size, rand_array,
index cdcda998bb10028cfb98cdd06299a1a0e8ac5f18..08bf8b39b84501284d2c5105352cec219d0b96c8 100644 (file)
@@ -17,7 +17,7 @@
 
 /*
  * Principal Author: Brian Wellington
- * $Id: opensslrsa_link.c,v 1.36 2009/10/28 21:07:09 marka Exp $
+ * $Id: opensslrsa_link.c,v 1.37 2009/10/30 05:08:23 marka Exp $
  */
 #ifdef OPENSSL
 #include <config.h>
@@ -708,11 +708,16 @@ opensslrsa_compare(const dst_key_t *key1, const dst_key_t *key2) {
 static int
 progress_cb(int p, int n, BN_GENCB *cb)
 {
-       void (*callback)(int) = cb->arg;
+       union {
+               void *dptr;
+               void (*fptr)(int);
+       } u;
 
        UNUSED(n);
-       if (callback != NULL)
-               callback(p);
+
+       u.dptr = cb->arg;
+       if (u.fptr != NULL)
+               u.fptr(p);
        return (1);
 }
 #endif
@@ -721,6 +726,10 @@ static isc_result_t
 opensslrsa_generate(dst_key_t *key, int exp, void (*callback)(int)) {
 #if OPENSSL_VERSION_NUMBER > 0x00908000L
        BN_GENCB cb;
+       union {
+               void *dptr;
+               void (*fptr)(int);
+       } u;
        RSA *rsa = RSA_new();
        BIGNUM *e = BN_new();
 #if USE_EVP
@@ -749,7 +758,8 @@ opensslrsa_generate(dst_key_t *key, int exp, void (*callback)(int)) {
        if (callback == NULL) {
                BN_GENCB_set_old(&cb, NULL, NULL);
        } else {
-               BN_GENCB_set(&cb, &progress_cb, callback);
+               u.fptr = callback;
+               BN_GENCB_set(&cb, &progress_cb, u.dptr);
        }
 
        if (RSA_generate_key_ex(rsa, key->key_size, e, &cb)) {