Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/lib/libc/string



In article <20100419021334.GA8829%britannica.bec.de@localhost>,
Joerg Sonnenberger  <joerg%britannica.bec.de@localhost> wrote:
>On Sun, Apr 18, 2010 at 10:51:35AM +0000, Alan Barrett wrote:
>> Log Message:
>> Bitwise operations on signed types are well-defined if the values
>> happen to be positive, and indeed the values here were guaranteed
>> to be positive, but some compilers complained anyway, so convert
>> the bitwise operations to arithmetic operations.
>
>In that case use an explicit cast to the unsigned type. What you did is
>penalize the code for no good reason.

Any compiler these days knows how to do these micro-optimizations.

christos



Home | Main Index | Thread Index | Old Index