summaryrefslogtreecommitdiff
path: root/src/md5sum.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1995-06-11 06:16:17 +0000
committerJim Meyering <jim@meyering.net>1995-06-11 06:16:17 +0000
commit8ddb66cff46798c87b54553fe28bf222676578a4 (patch)
treef5f902983c5a0cb1815dc037922262d983c5ae60 /src/md5sum.c
parent3763a4f24eb21be40674d13ff7b04e078f473e85 (diff)
downloadcoreutils-8ddb66cff46798c87b54553fe28bf222676578a4.tar.xz
[SWAP]: Parenthesize uses of macro argument.
Don't use autoconf macros that require running test programs.
Diffstat (limited to 'src/md5sum.c')
-rw-r--r--src/md5sum.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/md5sum.c b/src/md5sum.c
index 247bd4fab..e0e7969bd 100644
--- a/src/md5sum.c
+++ b/src/md5sum.c
@@ -33,13 +33,24 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#include <values.h>
#include <sys/types.h>
+#if defined (HAVE_LIMITS_H) || defined (_LIBC)
+# include <limits.h>
+#endif
+
+/* #define UINT_MAX_32_BITS ((unsigned int) 4294967294 + 1) */
+#define UINT_MAX_32_BITS 4294967295U
+
+#ifndef UINT_MAX
+# define UINT_MAX UINT_MAX_32_BITS
+#endif
+
#include "system.h"
#include "error.h"
#include "version.h"
#ifdef WORDS_BIGENDIAN
# define SWAP(n) \
- ((n << 24) | ((n & 0xff00) << 8) | ((n >> 8) & 0xff00) | (n >> 24))
+ (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
#else
# define SWAP(n) (n)
#endif
@@ -78,20 +89,20 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
# define INLINE __inline
#endif
-#if SIZEOF_UNSIGNED_INT == 4
+#if UINT_MAX == UINT_MAX_32_BITS
typedef unsigned int uint32;
-#elif SIZEOF_UNSIGNED_SHORT == 4
+#elif USHRT_MAX == UINT_MAX_32_BITS
typedef unsigned short uint32;
#else
/* The following line is intended to throw an error. Using #error is
not portable enough. */
- "Cannot determine unsigned 32-bit data type. I'm screwed"
+ "Cannot determine unsigned 32-bit data type."
#endif
/* Hook for i18n. */
#define _(str) str
-/* Structure to safe state of computation between the single steps. */
+/* Structure to save state of computation between the single steps. */
struct md5_ctx
{
uint32 A;
@@ -105,8 +116,7 @@ char *program_name;
/* This array contains the bytes used to pad the buffer to the next
64-byte boundary. (RFC 1321, 3.1: Step 1) */
-static const unsigned char fillbuf[64] = { 0x80, 0, };
-
+static const unsigned char fillbuf[64] = { 0x80, 0 };
static const struct option long_options[] =
{