From 7150110631ddecf52a6456d7d56dd915ffc483e7 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sat, 30 Nov 2013 22:46:06 +0800 Subject: [PATCH] Usermode/libc - Minor compilation fix --- Usermode/Libraries/libc.so_src/include_exp/stdio.h | 1 + Usermode/Libraries/libc.so_src/stdio.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) 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 ) { -- 2.20.1