Hello, On Sun, Oct 23, 2005 at 10:34:18PM -0700, Paul Eggert wrote: > uint32_t *p = (uint32_t *) ((char *) ctx->buffer + bytes + pad); > p[0] = SWAP (ctx->total[0] << 3); > p[1] = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29));
wouldn't the following be more readable? uint32_t bytes = ctx->buflen; size_t size = (bytes < 56) ? 64 / 4 : 64 * 2 / 4; /* Now count remaining bytes. */ ctx->total[0] += bytes; if (ctx->total[0] < bytes) ++ctx->total[1]; /* Put the 64-bit file length in *bits* at the end of the buffer. */ ctx->buffer[size - 2] = SWAP (ctx->total[0] << 3); ctx->buffer[size - 1] = SWAP ((ctx->total[1] << 3) | (ctx->total[0] >> 29)); memcpy (&((char*)ctx->buffer)[bytes], fillbuf, (size - 2) * 4 - bytes); /* Process last bytes. */ md5_process_block (ctx->buffer, size * 4, ctx); Do I understand correctly that this is only executed for the last block, so that it's not necessary to be so careful about each tick? Have a nice day, Stepan _______________________________________________ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnulib