On Thu, Mar 22, 2012 at 08:54:49AM +0000, Havard Eidnes wrote:
> Module Name:  src
> Committed By: he
> Date:         Thu Mar 22 08:54:48 UTC 2012
> 
> Modified Files:
>       src/lib/libarch/alpha: alpha_pci_io.c
> 
> Log Message:
> Add a cast of the shift count to int32_t, so that we don't try
> to do int32_t << long, since ANSI C doesn't perform "balancing"
> before the shift operation according to lint.  Should not make a
> difference, offset is limited to 0..3 anyway.

Again, why is this needed or desirable? Both sides of the operator are
unsigned, so in the worst case, promition happens to the wider of the
type and the result is truncated immediately. The casts are yet again
just making the code uglier.

Joerg

Reply via email to