Commit graph

6 commits

Author SHA1 Message Date
Ori Bernstein 46faca54ed 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.
2020-08-10 19:36:09 -07:00
Ori Bernstein 2d59d75e3a 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.
2020-07-19 14:14:14 -07:00
Ori Bernstein 1987cc69c8 stdio, ape/stdio: fix order of operations in putc
When calling putc, we need to return either EOF
or the character returned. To distinguish the
two, we need to avoid sign extending 0xff. The
code attempted to do this, but the order of
operations was wrong, so we ended up masking,
setting a character, and then sign extending
the character.

This fixes things so we mask after assignment.
2020-07-11 13:28:58 -07:00
cinap_lenrek 4b4d68487c stdio: fix putc(), plan9 version 2019-06-20 00:04:58 +02:00
Taru Karttunen a9060cc06b Import sources from 2011-03-30 iso image - lib 2011-03-30 19:35:09 +03:00
Taru Karttunen c558a99e0b Import sources from 2011-03-30 iso image - sys/include 2011-03-30 16:47:56 +03:00