From 7dc6bd90c569c49807462b0740b18e32fab4d8b7 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 19 Jul 2011 16:53:43 -0400 Subject: Use union to avoid casts in code to store results of hashsum computations --- crypt/md5.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'crypt/md5.h') 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]; + }; }; /* -- cgit 1.4.1