Simon Josefsson <[EMAIL PROTECTED]> writes: > - *(uint32_t *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3); > - *(uint32_t *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) | > - (ctx->total[0] >> 29)); > + ctx->buffer[(bytes + pad) / 4] = SWAP (ctx->total[0] << 3); > + ctx->buffer[(bytes + pad) / 4 + 1] = SWAP ((ctx->total[1] << 3) | > + (ctx->total[0] >> 29));
This sort of thing generates worse code than the original, no? The compiler isn't smart enough to know that bytes + pad is a multiple of 4. Shouldn't the code look something like this instead? 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)); Also, in some other places I noticed some "char*"s. GNU style is to put a space between the type and the trailing "*" for pointer types, e.g., "char *" rather than "char*". _______________________________________________ bug-gnulib mailing list bug-gnulib@gnu.org http://lists.gnu.org/mailman/listinfo/bug-gnulib