From: Paul Eggert Date: Sat, 12 Feb 2011 22:36:22 +0000 (-0800) Subject: * md5.c (md5_process_bytes): Use sizeof, not __alignof__. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~913 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=33d605d0d1a5902ae1e8f9f9bed9e961233bbc43;p=emacs.git * 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. --- diff --git a/src/ChangeLog b/src/ChangeLog index 8ba7b61290e..4469297e32f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2011-02-12 Paul Eggert + + * 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 * process.c (create_process): Reset SIGPIPE handler in the child. diff --git a/src/md5.c b/src/md5.c index 9d9d7d8f14f..5ac4536cff9 100644 --- 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; } -