summaryrefslogtreecommitdiff
path: root/cipher/md.c
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@iki.fi>2014-12-23 13:01:33 +0200
committerJussi Kivilinna <jussi.kivilinna@iki.fi>2014-12-25 11:16:49 +0200
commit4515315f61fbf79413e150fbd1d5f5a2435f2bc5 (patch)
tree28b79e129c5c74913f06dffbd1bd596d5d977ced /cipher/md.c
parentcc26106dbebeb84d481661813edc3e5aea9a7d99 (diff)
downloadlibgcrypt-4515315f61fbf79413e150fbd1d5f5a2435f2bc5.tar.gz
hash: fix compiler warning on ARM
* cipher/md.c (md_open, md_copy): Cast 'char *' to ctx through 'void *'. * cipher/md4.c (md4_final): Use buf_put_* helper instead of converting 'char *' to 'u32 *'. * cipher/md5.c (md5_final): Ditto. * cipher/rmd160.c (_gcry_rmd160_mixblock, rmd160_final): Ditto. * cipher/sha1.c (sha1_final): Ditto. * cipher/sha256.c (sha256_final): Ditto. * cipher/sha512.c (sha512_final): Ditto. * cipher/tiger.c (tiger_final): Ditto. -- Patch fixes 'cast increases required alignment' warnings seen on GCC: md.c: In function 'md_open': md.c:318:23: warning: cast increases required alignment of target type [-Wcast-align] hd->ctx = ctx = (struct gcry_md_context *) ((char *) hd + n); ^ md.c: In function 'md_copy': md.c:491:22: warning: cast increases required alignment of target type [-Wcast-align] bhd->ctx = b = (struct gcry_md_context *) ((char *) bhd + n); ^ md4.c: In function 'md4_final': md4.c:258:20: warning: cast increases required alignment of target type [-Wcast-align] #define X(a) do { *(u32*)p = le_bswap32((*hd).a) ; p += 4; } while(0) ^ md4.c:259:3: note: in expansion of macro 'X' X(A); ^ md4.c:258:20: warning: cast increases required alignment of target type [-Wcast-align] #define X(a) do { *(u32*)p = le_bswap32((*hd).a) ; p += 4; } while(0) ^ md4.c:260:3: note: in expansion of macro 'X' X(B); ^ [removed the rest] Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Diffstat (limited to 'cipher/md.c')
-rw-r--r--cipher/md.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cipher/md.c b/cipher/md.c
index df8b027e..f9414def 100644
--- a/cipher/md.c
+++ b/cipher/md.c
@@ -315,7 +315,7 @@ md_open (gcry_md_hd_t *h, int algo, unsigned int flags)
if (! err)
{
- hd->ctx = ctx = (struct gcry_md_context *) ((char *) hd + n);
+ hd->ctx = ctx = (void *) ((char *) hd + n);
/* Setup the globally visible data (bctl in the diagram).*/
hd->bufsize = n - sizeof (struct gcry_md_handle) + 1;
hd->bufpos = 0;
@@ -488,7 +488,7 @@ md_copy (gcry_md_hd_t ahd, gcry_md_hd_t *b_hd)
if (! err)
{
- bhd->ctx = b = (struct gcry_md_context *) ((char *) bhd + n);
+ bhd->ctx = b = (void *) ((char *) bhd + n);
/* No need to copy the buffer due to the write above. */
gcry_assert (ahd->bufsize == (n - sizeof (struct gcry_md_handle) + 1));
bhd->bufsize = ahd->bufsize;