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

Re: [MiNT] [PATCH][MiNTlib] Add ColdFire information to sysinfo



2016-02-04 14:37 GMT+01:00 Vincent Rivière <vincent.riviere@freesbee.fr>:
> On 04/02/2016 12:19, Andreas Schwab wrote:
>>
>> 0xFFFF wouldn't match since hi is sign-extended.
>
>
> Right.
>
>>      long hi, lo;
>
> ...
>>
>>        hi = (_mch & 0xffff0000) >> 16;
>>        lo = (_mch & 0xffff);
>
>
> If the hi and lo values are supposed to be signed, they should be declared
> as:
> short hi, lo;
>

OK, I'll prepare another patch with those variables being short and
the case tested as -1 again.

> Anyway, I would prefer to use unsigned types for such kind of stuff:
> http://toshyp.atari.org/en/003007.html#Cookie_2C_20_MCH
>

There it says -1 is non ST compatible hardware.