提交 d8870dcf 编写于 作者: R Rich Felker

optimize internal putc_unlocked macro used in putc

to check whether flush due to line buffering is needed, the int-type
character argument must be truncated to unsigned char for comparison.
if the original value is subsequently passed to __overflow, it must be
preserved, adding to register pressure. since it doesn't matter,
truncate all uses so the original value is no longer live.
上级 a21a6092
...@@ -106,7 +106,8 @@ hidden void __getopt_msg(const char *, const char *, const char *, size_t); ...@@ -106,7 +106,8 @@ hidden void __getopt_msg(const char *, const char *, const char *, size_t);
#define putc_unlocked(c, f) \ #define putc_unlocked(c, f) \
( (((unsigned char)(c)!=(f)->lbf && (f)->wpos!=(f)->wend)) \ ( (((unsigned char)(c)!=(f)->lbf && (f)->wpos!=(f)->wend)) \
? *(f)->wpos++ = (c) : __overflow((f),(c)) ) ? *(f)->wpos++ = (unsigned char)(c) \
: __overflow((f),(unsigned char)(c)) )
/* Caller-allocated FILE * operations */ /* Caller-allocated FILE * operations */
hidden FILE *__fopen_rb_ca(const char *, FILE *, unsigned char *, size_t); hidden FILE *__fopen_rb_ca(const char *, FILE *, unsigned char *, size_t);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册