diff options
author | Rich Felker <dalias@aerifal.cx> | 2018-10-18 13:53:44 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2018-10-18 13:59:17 -0400 |
commit | 8084d6ab57cdb0b8f328d3cdbad3b9d09eaaee04 (patch) | |
tree | 06085b5a8b423003cca5bdf266e2c41a38b017b0 /src/passwd/putpwent.c | |
parent | d8870dcf385a75ae8df2f8bb5bd5ee59525ed348 (diff) | |
download | musl-8084d6ab57cdb0b8f328d3cdbad3b9d09eaaee04.tar.gz musl-8084d6ab57cdb0b8f328d3cdbad3b9d09eaaee04.tar.bz2 musl-8084d6ab57cdb0b8f328d3cdbad3b9d09eaaee04.tar.xz musl-8084d6ab57cdb0b8f328d3cdbad3b9d09eaaee04.zip |
adjust types in FILE struct to make line buffering check less expensive
the choice of signed char for lbf was a theoretically space-saving
hack that was not helping, and was unwantedly expensive. while
comparing bytes against a byte-sized member sounds easy, the trick
here was that the byte to be compared was unsigned while the lbf
member was signed, making it possible to set lbf negative to disable
line buffering. however, this imposed a requirement to promote both
operands, zero-extending one and sign-extending the other, in order to
compare them.
to fix this, repurpose the waiters count slot (unused since commit
c21f750727515602a9e84f2a190ee8a0a2aeb2a1). while we're at it, switch
mode (orientation) from signed char to int as well. this makes no
semantic difference (its only possible values are -1, 0, and 1) but it
might help on archs where byte access is awkward.
Diffstat (limited to 'src/passwd/putpwent.c')
0 files changed, 0 insertions, 0 deletions