diff options
author | Ori Bernstein <ori@eigenstate.org> | 2020-08-10 19:36:09 -0700 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2020-08-10 19:36:09 -0700 |
commit | 46faca54edf1eda39a45f540697196074a00c779 (patch) | |
tree | 789fb2f8b5b3daf70de0be53a87adc3d97a91b1e /sys/include | |
parent | 1e315f896d9496e22546304ef8b2de74b9451fc4 (diff) |
stdio.h: correct return type of putc
The putc macro is specified as returning an int, but our
type conversion rules turned it into a uint. Put in the
appropriate cast to make the type what we want.
Diffstat (limited to 'sys/include')
-rw-r--r-- | sys/include/ape/stdio.h | 2 | ||||
-rw-r--r-- | sys/include/stdio.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/include/ape/stdio.h b/sys/include/ape/stdio.h index c961a5da1..defa3ac1f 100644 --- a/sys/include/ape/stdio.h +++ b/sys/include/ape/stdio.h @@ -106,7 +106,7 @@ extern int getchar(void); #define getchar() getc(stdin) extern char *gets(char *); extern int putc(int, FILE *); -#define putc(c, f) ((f)->wp>=(f)->rp?_IO_putc(c, f):(*(unsigned char*)(f)->wp++=(c)&_IO_CHMASK)) +#define putc(c, f) ((f)->wp>=(f)->rp?_IO_putc(c, f):(int)(*(unsigned char*)(f)->wp++=(c)&_IO_CHMASK)) extern int _IO_putc(int, FILE *); extern int putchar(int); #define putchar(c) putc(c, stdout) diff --git a/sys/include/stdio.h b/sys/include/stdio.h index 39f3b73e7..0daae2f48 100644 --- a/sys/include/stdio.h +++ b/sys/include/stdio.h @@ -92,7 +92,7 @@ int getchar(void); #define getchar() getc(stdin) char *gets(char *); int putc(int, FILE *); -#define putc(c, f) ((f)->wp>=(f)->rp?_IO_putc(c, f):(*(unsigned char*)(f)->wp++=(c)&_IO_CHMASK)) +#define putc(c, f) ((f)->wp>=(f)->rp?_IO_putc(c, f):(int)(*(unsigned char*)(f)->wp++=(c)&_IO_CHMASK)) int _IO_putc(int, FILE *); int putchar(int); #define putchar(c) putc(c, stdout) |