On 14.07.2012 23:05, Nikita Egorov wrote:

>> Reopened on request of OP.
>>
>> It seems clear to me that the attempted fix in r 9363 doesn't solve the
>> OP's problem, since it would preserve *negative* char (int) values.
>>
>> Using both casts looks appropriate to make sure char codes > 127 are
>> positive int's.
>>
>> Nikita, could you please confirm that svn r9635 solves the problem?
>> Leaving the STR open for confirmation...
>
> Hi, Albrecht. At the moment fluid works very well.

Thanks for confirmation.

> But I don't understand why you had not removed the (int). isspace((unsigned 
> char)*n)) is enough!

(1) to be absolutely sure that NO compiler would issue a warning.
(2) because I don't know why EXACTLY Fabien changed the existing
     (unsigned char) cast to (int).
(3) to document that we REALLY want both casts in sequence.

> Compilers (I tested VC++, mingw-gcc, ubuntu-gcc) cast to type int in any case 
> and they print no warning because it's absolutely safe. We only say to 
> compiler: "Don't extend the sign bit when you will convert our character to 
> int".

Yes, I also think that it would have been enough, but see above.

BTW, since this is only a compiler information, this additional
cast doesn't add any runtime (performance) penalty, so I think
that it is okay anyway.

I'm going to close the STR now...

-- 

Albrecht


_______________________________________________
fltk-bugs mailing list
fltk-bugs@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-bugs

Reply via email to