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

Re: [XaraXtreme-dev] patch for warnings (3)



Brian,

The point of EOF is that it's not a char at all, so that data isn't
confused with the end of the file.  Hence why the standard libraries
tend to use int.  So I suspect that the current code will falsely report
end of file if the data read contains 0xff.

Yes you are quite right. The current code is pretty disgusting in this
respect. Fortunately, it's really only dealing with 7 bit ASCII, and isn't
so much checking something it calls against returning EOF, but attempting
to insert its own EOF character as return data into a char[] buffer. Given
this will always have been broken for anything expecting the full 8 bits I
can only assume it's not used in that way. The ccfile class and derivatives
are not the most beautifully designed bits of Camelot, sadly. It is also
rather schizophrenic about Unicode. The cast I put in really just
suppressed the warning, and did not address the underlying problem.

Alex