Source-Changes archive

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

Re: CVS commit: src/dist/nvi/common



Tom Spindler wrote:
>> Fix a warning which breaks the build on a few platforms.
>> XXX may be not the right thing to do, but very little intrusive
> 
> I found myself wondering about that - why does the warning only show
> up on arm and macppc? Do they default to unsigned chars or something?
> (It looks like the code is relatively unchanged from what was in
> usr.bin/vi; did it have a lower WARNS= level?)

Arm has unsigned chars as it saves having to do the sign extension for
signed chars.  As the sign of a number in Arm is always in the top bit
of the register, so to load a signed char requires a shift left by 24
bits, then arithmetical shift right by 24 to produce a signed char.

However in this case I think the bug is that UCHAR_T is either u_char or
u_int (depending on USE_WIDECHAR) and so the test is actually wanting to
handle standard keys quickly, and wide/unicode chars differently.

Thanks
Chris



Home | Main Index | Thread Index | Old Index