* md5.c (md5_process_bytes): Use sizeof, not __alignof__.
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 12 Feb 2011 22:36:22 +0000 (14:36 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 12 Feb 2011 22:36:22 +0000 (14:36 -0800)
The difference doesn't matter here, in practice, and sizeof is
more portable to non-GCC compilers.  Also, this makes the code
match the already-existing comment.

src/ChangeLog
src/md5.c

index 8ba7b61..4469297 100644 (file)
@@ -1,3 +1,10 @@
+2011-02-12  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * md5.c (md5_process_bytes): Use sizeof, not __alignof__.
+       The difference doesn't matter here, in practice, and sizeof is
+       more portable to non-GCC compilers.  Also, this makes the code
+       match the already-existing comment.
+
 2011-02-12  Andreas Schwab  <schwab@linux-m68k.org>
 
        * process.c (create_process): Reset SIGPIPE handler in the child.
index 9d9d7d8..5ac4536 100644 (file)
--- a/src/md5.c
+++ b/src/md5.c
@@ -216,7 +216,7 @@ md5_process_bytes (const void *buffer, size_t len, struct md5_ctx *ctx)
       size_t add = 128 - left_over > len ? len : 128 - left_over;
 
       /* Only put full words in the buffer.  */
-      add -= add % __alignof__ (md5_uint32);
+      add -= add % sizeof (md5_uint32);
 
       memcpy (&ctx->buffer[left_over], buffer, add);
       ctx->buflen += add;
@@ -427,4 +427,3 @@ md5_process_block (const void *buffer, size_t len, struct md5_ctx *ctx)
   ctx->C = C;
   ctx->D = D;
 }
-