aboutsummaryrefslogtreecommitdiffstats
path: root/engines
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2017-03-30 23:07:26 +0200
committerAndy Polyakov <appro@openssl.org>2017-04-01 15:47:02 +0200
commitc27778d8adf7fca3128ece0b7efca09f628008b9 (patch)
tree3bd39148e40069d4ccb768d6a3d71e6cc074e845 /engines
parent15b337fa58ba822eb1e67d03a192c390a941efa7 (diff)
downloadopenssl-c27778d8adf7fca3128ece0b7efca09f628008b9.tar.gz
e_afalg.[ch]: fix --strict-warnings with gcc 4.x and 32-bit build.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'engines')
-rw-r--r--engines/afalg/e_afalg.c16
-rw-r--r--engines/afalg/e_afalg.h5
2 files changed, 11 insertions, 10 deletions
diff --git a/engines/afalg/e_afalg.c b/engines/afalg/e_afalg.c
index 9837cae9c4..5ce9047105 100644
--- a/engines/afalg/e_afalg.c
+++ b/engines/afalg/e_afalg.c
@@ -236,15 +236,11 @@ int afalg_fin_cipher_aio(afalg_aio *aio, int sfd, unsigned char *buf,
memset(cb, '\0', sizeof(*cb));
cb->aio_fildes = sfd;
cb->aio_lio_opcode = IOCB_CMD_PREAD;
- if (sizeof(buf) != sizeof(cb->aio_buf)) {
- /*
- * The pointer has to be converted to 32 bit unsigned value first
- * to avoid sign extension on cast to 64 bit value
- */
- cb->aio_buf = (uint64_t)(unsigned long)buf;
- } else {
- cb->aio_buf = (uint64_t)buf;
- }
+ /*
+ * The pointer has to be converted to unsigned value first to avoid
+ * sign extension on cast to 64 bit value in 32-bit builds
+ */
+ cb->aio_buf = (size_t)buf;
cb->aio_offset = 0;
cb->aio_data = 0;
cb->aio_nbytes = len;
@@ -364,9 +360,9 @@ static int afalg_create_sk(afalg_ctx *actx, const char *ciphertype,
const char *ciphername)
{
struct sockaddr_alg sa;
+ int r = -1;
actx->bfd = actx->sfd = -1;
- int r = -1;
memset(&sa, 0, sizeof(sa));
sa.salg_family = AF_ALG;
diff --git a/engines/afalg/e_afalg.h b/engines/afalg/e_afalg.h
index 8f4d2d11f1..948d67e584 100644
--- a/engines/afalg/e_afalg.h
+++ b/engines/afalg/e_afalg.h
@@ -10,6 +10,11 @@
#ifndef HEADER_AFALG_H
# define HEADER_AFALG_H
+# if defined(__GNUC__) && __GNUC__ >= 4 && \
+ (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L)
+# pragma GCC diagnostic ignored "-Wvariadic-macros"
+# endif
+
# ifdef ALG_DEBUG
# define ALG_DGB(x, ...) fprintf(stderr, "ALG_DBG: " x, __VA_ARGS__)
# define ALG_INFO(x, ...) fprintf(stderr, "ALG_INFO: " x, __VA_ARGS__)