diff options
author | Ori Bernstein <ori@eigenstate.org> | 2020-07-19 14:14:14 -0700 |
---|---|---|
committer | Ori Bernstein <ori@eigenstate.org> | 2020-07-19 14:14:14 -0700 |
commit | 2d59d75e3a4faa51bfc146f70aea7734cd8bb9ef (patch) | |
tree | 409c2cc466a403db2b3445f2be57484d1cfc4277 /sys/include/ape/stdio.h | |
parent | 9ea93a5fd347a04ed409c46410cd5ead033c0695 (diff) |
stdio: fix warnings, make code more standard
Masking with _IO_CHMASK after the assignment causes a warning.
We're better off masking before, but casting the assignment to
prevent sign extension.
Diffstat (limited to 'sys/include/ape/stdio.h')
-rw-r--r-- | sys/include/ape/stdio.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/include/ape/stdio.h b/sys/include/ape/stdio.h index b05f41e69..c961a5da1 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):((*(f)->wp++=(c))&_IO_CHMASK)) +#define putc(c, f) ((f)->wp>=(f)->rp?_IO_putc(c, f):(*(unsigned char*)(f)->wp++=(c)&_IO_CHMASK)) extern int _IO_putc(int, FILE *); extern int putchar(int); #define putchar(c) putc(c, stdout) |