On Mon, Jul 12, 2010 at 02:29:28 -0700, Daniel Stone wrote: > xkbscan.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > New commits: > commit 61b3d4b024d8146cb0e7659aa958045ceb72c482 > Author: Julien Cristau <[email protected]> > Date: Mon Jul 12 10:28:32 2010 +0100 > > Fix signedness issue with getc() return value > > getc() and ungetc() return and take, respectively, an int rather than a > char to allow for error values as well. Oops. > > Signed-off-by: Daniel Stone <[email protected]> > The patch I tested didn't change unscanchar(), and I'm not sure changing it will work correctly. On end of file, scanchar() will set readBuf[readBufPos] to (char)EOF. Then unscanchar(EOF) will compare EOF with (char)EOF, which will fail if char is unsigned.
Overall I think it'd be better to just revert the commit introducing these functions, and let stdio handle the buffering. And maybe use getc_unlocked (which is a macro) if available. Cheers, Julien _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
