Skip to content

Commit

Permalink
add (void *) intermediate casts to elide gcc function cast warnings. …
Browse files Browse the repository at this point in the history
…This

is the simplest solution; choices:
- add pragmas, complex and ugly (need to be gcc-specific)
- add -Wno to COPTS. Needs to be done in many makefiles because of rump
- add intermediate functions: slows down things
  • Loading branch information
zoulasc committed Oct 12, 2019
1 parent 48fd4ad commit fbd28bc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions sys/opencrypto/cryptosoft.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: cryptosoft.c,v 1.53 2019/07/11 23:27:24 christos Exp $ */
/* $NetBSD: cryptosoft.c,v 1.54 2019/10/12 00:49:30 christos Exp $ */
/* $FreeBSD: src/sys/opencrypto/cryptosoft.c,v 1.2.2.1 2002/11/21 23:34:23 sam Exp $ */
/* $OpenBSD: cryptosoft.c,v 1.35 2002/04/26 08:43:50 deraadt Exp $ */

Expand All @@ -24,7 +24,7 @@
*/

#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cryptosoft.c,v 1.53 2019/07/11 23:27:24 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: cryptosoft.c,v 1.54 2019/10/12 00:49:30 christos Exp $");

#include <sys/param.h>
#include <sys/systm.h>
Expand Down Expand Up @@ -500,15 +500,15 @@ swcr_authcompute(struct cryptop *crp, struct cryptodesc *crd,
break;
case CRYPTO_BUF_MBUF:
err = m_apply((struct mbuf *) buf, crd->crd_skip, crd->crd_len,
(int (*)(void*, void *, unsigned int)) axf->Update,
(int (*)(void*, void *, unsigned int))(void *)axf->Update,
(void *) &ctx);
if (err)
return err;
break;
case CRYPTO_BUF_IOV:
err = cuio_apply((struct uio *) buf, crd->crd_skip,
crd->crd_len,
(int (*)(void *, void *, unsigned int)) axf->Update,
(int (*)(void *, void *, unsigned int))(void *)axf->Update,
(void *) &ctx);
if (err) {
return err;
Expand Down
18 changes: 9 additions & 9 deletions sys/opencrypto/cryptosoft_xform.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* $NetBSD: cryptosoft_xform.c,v 1.27 2014/11/27 20:30:21 christos Exp $ */
/* $NetBSD: cryptosoft_xform.c,v 1.28 2019/10/12 00:49:30 christos Exp $ */
/* $FreeBSD: src/sys/opencrypto/xform.c,v 1.1.2.1 2002/11/21 23:34:23 sam Exp $ */
/* $OpenBSD: xform.c,v 1.19 2002/08/16 22:47:25 dhartmei Exp $ */

Expand Down Expand Up @@ -40,7 +40,7 @@
*/

#include <sys/cdefs.h>
__KERNEL_RCSID(1, "$NetBSD: cryptosoft_xform.c,v 1.27 2014/11/27 20:30:21 christos Exp $");
__KERNEL_RCSID(1, "$NetBSD: cryptosoft_xform.c,v 1.28 2019/10/12 00:49:30 christos Exp $");

#include <crypto/blowfish/blowfish.h>
#include <crypto/cast128/cast128.h>
Expand Down Expand Up @@ -313,26 +313,26 @@ static const struct swcr_auth_hash swcr_auth_hash_sha1 = {

static const struct swcr_auth_hash swcr_auth_hash_hmac_sha2_256 = {
&auth_hash_hmac_sha2_256, sizeof(SHA256_CTX),
(void (*)(void *)) SHA256_Init, NULL, NULL, SHA256Update_int,
(void (*)(u_int8_t *, void *)) SHA256_Final
(void (*)(void *))(void *)SHA256_Init, NULL, NULL, SHA256Update_int,
(void (*)(u_int8_t *, void *))(void *)SHA256_Final
};

static const struct swcr_auth_hash swcr_auth_hash_hmac_sha2_384 = {
&auth_hash_hmac_sha2_384, sizeof(SHA384_CTX),
(void (*)(void *)) SHA384_Init, NULL, NULL, SHA384Update_int,
(void (*)(u_int8_t *, void *)) SHA384_Final
(void (*)(void *))(void *)SHA384_Init, NULL, NULL, SHA384Update_int,
(void (*)(u_int8_t *, void *))(void *)SHA384_Final
};

static const struct swcr_auth_hash swcr_auth_hash_hmac_sha2_512 = {
&auth_hash_hmac_sha2_512, sizeof(SHA512_CTX),
(void (*)(void *)) SHA512_Init, NULL, NULL, SHA512Update_int,
(void (*)(u_int8_t *, void *)) SHA512_Final
(void (*)(void *))(void *)SHA512_Init, NULL, NULL, SHA512Update_int,
(void (*)(u_int8_t *, void *))(void *)SHA512_Final
};

static const struct swcr_auth_hash swcr_auth_hash_aes_xcbc_mac = {
&auth_hash_aes_xcbc_mac_96, sizeof(aesxcbc_ctx),
null_init,
(void (*)(void *, const u_int8_t *, u_int16_t))aes_xcbc_mac_init,
(void (*)(void *, const u_int8_t *, u_int16_t))(void *)aes_xcbc_mac_init,
NULL, aes_xcbc_mac_loop, aes_xcbc_mac_result
};

Expand Down

0 comments on commit fbd28bc

Please sign in to comment.