From: John Hodge Date: Sat, 30 Nov 2013 14:46:06 +0000 (+0800) Subject: Usermode/libc - Minor compilation fix X-Git-Tag: rel0.15~67 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=7150110631ddecf52a6456d7d56dd915ffc483e7;p=tpg%2Facess2.git Usermode/libc - Minor compilation fix --- diff --git a/Usermode/Libraries/libc.so_src/include_exp/stdio.h b/Usermode/Libraries/libc.so_src/include_exp/stdio.h index 315bebfc..4d812a7b 100644 --- a/Usermode/Libraries/libc.so_src/include_exp/stdio.h +++ b/Usermode/Libraries/libc.so_src/include_exp/stdio.h @@ -99,6 +99,7 @@ extern size_t fread(void *buf, size_t size, size_t n, FILE *fp); extern size_t fwrite(const void *buf, size_t size, size_t n, FILE *fp); extern int fgetc(FILE *fp); #define getc(fp) fgetc(fp) +extern int ungetc(int c, FILE *fp); extern char *fgets(char *s, int size, FILE *fp); extern int fputc(int ch, FILE *fp); extern int fputs(const char *s, FILE *fp); diff --git a/Usermode/Libraries/libc.so_src/stdio.c b/Usermode/Libraries/libc.so_src/stdio.c index 372c4899..f252ec47 100644 --- a/Usermode/Libraries/libc.so_src/stdio.c +++ b/Usermode/Libraries/libc.so_src/stdio.c @@ -615,9 +615,9 @@ size_t _fread_buffered(void *ptr, size_t size, FILE *fp) _SysDebug("%p: %i-%i <= %i", fp, (int)fp->Pos, (int)fp->BufferOfs, (int)fp->BufferPos); if( fp->BufferPos > 0 ) { - assert( fp->Pos - fp->BufferOfs <= fp->BufferPos ); + assert( fp->Pos - fp->BufferOfs <= (int)fp->BufferPos ); } - if( fp->BufferPos == 0 || fp->Pos - fp->BufferOfs == fp->BufferPos ) + if( fp->BufferPos == 0 || fp->Pos - fp->BufferOfs == (int)fp->BufferPos ) { int rv = _SysRead(fp->FD, fp->Buffer, fp->BufferSpace); if( rv <= 0 ) {