aboutsummaryrefslogtreecommitdiff
path: root/crypt/md5.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@gmail.com>2011-07-19 16:53:43 -0400
committerUlrich Drepper <drepper@gmail.com>2011-07-19 16:53:43 -0400
commit7dc6bd90c569c49807462b0740b18e32fab4d8b7 (patch)
tree1b6b4a3df6408992625f329206dbe98619589a17 /crypt/md5.h
parente0e722848005e335132015a64a09cad7f7a12073 (diff)
downloadglibc-7dc6bd90c569c49807462b0740b18e32fab4d8b7.tar
glibc-7dc6bd90c569c49807462b0740b18e32fab4d8b7.tar.gz
glibc-7dc6bd90c569c49807462b0740b18e32fab4d8b7.tar.bz2
glibc-7dc6bd90c569c49807462b0740b18e32fab4d8b7.zip
Use union to avoid casts in code to store results of hashsum computations
Diffstat (limited to 'crypt/md5.h')
-rw-r--r--crypt/md5.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/crypt/md5.h b/crypt/md5.h
index b474a84b8b..64a73bdc83 100644
--- a/crypt/md5.h
+++ b/crypt/md5.h
@@ -1,6 +1,6 @@
/* Declaration of functions and data types used for MD5 sum computing
library functions.
- Copyright (C) 1995-1997,1999,2000,2001,2004,2005
+ Copyright (C) 1995-1997,1999,2000,2001,2004,2005,2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -68,7 +68,7 @@ typedef uintptr_t md5_uintptr;
typedef unsigned long md5_uint32;
# else
/* The following line is intended to evoke an error.
- Using #error is not portable enough. */
+ Using #error is not portable enough. */
"Cannot determine unsigned 32-bit data type."
# endif
# endif
@@ -88,7 +88,11 @@ struct md5_ctx
md5_uint32 total[2];
md5_uint32 buflen;
- char buffer[128] __attribute__ ((__aligned__ (__alignof__ (md5_uint32))));
+ union
+ {
+ char buffer[128];
+ md5_uint32 buffer32[32];
+ };
};
/*