[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]
Re: [XaraXtreme-dev] patch for warnings (3)
- From: bacam@xxxxxxxxxxx (Brian Campbell)
- Date: Sun, 9 Jul 2006 13:29:36 +0100
- Subject: Re: [XaraXtreme-dev] patch for warnings (3)
On Tue, Jul 04, 2006 at 09:43:54AM +0100, Alex Bligh wrote:
> --On 04 July 2006 07:34 +0100 Ben Fowler <ben.the.mole@xxxxxxxxx> wrote:
> The first two patches I'd take and will apply in a bit, but not this one
> >On Gentoo linux PPC (GCC4.1.1) I get several warnings where it seems
> >that there is mixed char and int arithmetic.
> >This patch shows the problem.
> All these should do is cast EOF to "unsigned char" (or whatever "Ch" is).
> Using hardcoded values is not nice. Alternatively, #define something
> locally to be the casted version of EOF.
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.