Chromium Code Reviews| Index: fusl/src/stdio/vfprintf.c |
| diff --git a/fusl/src/stdio/vfprintf.c b/fusl/src/stdio/vfprintf.c |
| index 2ecf76925c97f3ee34faf03b3b23a6e5c1c2dc81..d37e0c1a55bd28093543c63e1da4e9f8ded39639 100644 |
| --- a/fusl/src/stdio/vfprintf.c |
| +++ b/fusl/src/stdio/vfprintf.c |
| @@ -17,12 +17,12 @@ |
| /* Convenient bit representation for modifier flags, which all fall |
| * within 31 codepoints of the space character. */ |
| -#define ALT_FORM (1U<<'#'-' ') |
| -#define ZERO_PAD (1U<<'0'-' ') |
| -#define LEFT_ADJ (1U<<'-'-' ') |
| -#define PAD_POS (1U<<' '-' ') |
| -#define MARK_POS (1U<<'+'-' ') |
| -#define GROUPED (1U<<'\''-' ') |
| +#define ALT_FORM (1U<<('#'-' ')) |
| +#define ZERO_PAD (1U<<('0'-' ')) |
| +#define LEFT_ADJ (1U<<('-'-' ')) |
| +#define PAD_POS (1U<<(' '-' ')) |
| +#define MARK_POS (1U<<('+'-' ')) |
| +#define GROUPED (1U<<('\''-' ')) |
| #define FLAGMASK (ALT_FORM|ZERO_PAD|LEFT_ADJ|PAD_POS|MARK_POS|GROUPED) |
| @@ -485,8 +485,8 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, |
| } |
| /* Read modifier flags */ |
| - for (fl=0; (unsigned)*s-' '<32 && (FLAGMASK&(1U<<*s-' ')); s++) |
| - fl |= 1U<<*s-' '; |
| + for (fl=0; (unsigned)*s-' '<32 && (FLAGMASK&(1U<<(*s-' ')));s++) |
|
viettrungluu
2016/01/12 18:40:02
nit: probably you shouldn't remove the space after
kulakowski
2016/01/12 19:50:24
Done.
|
| + fl |= 1U<<(*s-' '); |
| /* Read field width */ |
| if (*s=='*') { |