Changeset 28a5ebd in mainline for kernel/generic/src/printf/printf_core.c
- Timestamp:
- 2020-06-18T15:39:50Z (4 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ce52c333
- Parents:
- 4f663f3e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/printf/printf_core.c
r4f663f3e r28a5ebd 139 139 * 140 140 */ 141 static int printf_wputnchars(const wchar_t *buf, size_t size,141 static int printf_wputnchars(const char32_t *buf, size_t size, 142 142 printf_spec_t *ps) 143 143 { … … 185 185 * 186 186 */ 187 static int printf_put wchar(const wchar_t ch, printf_spec_t *ps)187 static int printf_putuchar(const char32_t ch, printf_spec_t *ps) 188 188 { 189 189 if (!chr_check(ch)) 190 190 return ps->str_write((void *) &invalch, 1, ps->data); 191 191 192 return ps->wstr_write(&ch, sizeof( wchar_t), ps->data);192 return ps->wstr_write(&ch, sizeof(char32_t), ps->data); 193 193 } 194 194 … … 240 240 * 241 241 */ 242 static int print_wchar(const wchar_t ch, int width, uint32_t flags, printf_spec_t *ps)242 static int print_wchar(const char32_t ch, int width, uint32_t flags, printf_spec_t *ps) 243 243 { 244 244 size_t counter = 0; … … 254 254 } 255 255 256 if (printf_put wchar(ch, ps) > 0)256 if (printf_putuchar(ch, ps) > 0) 257 257 counter++; 258 258 … … 326 326 * @return Number of wide characters printed, negative value on failure. 327 327 */ 328 static int print_wstr( wchar_t *str, int width, unsigned int precision,328 static int print_wstr(char32_t *str, int width, unsigned int precision, 329 329 uint32_t flags, printf_spec_t *ps) 330 330 { … … 576 576 * - "l" Signed or unsigned long int.@n 577 577 * If conversion is "c", the character is wint_t (wide character).@n 578 * If conversion is "s", the string is wchar_t * (widestring).@n578 * If conversion is "s", the string is char32_t * (UTF-32 string).@n 579 579 * - "ll" Signed or unsigned long long int.@n 580 580 * - "z" Signed or unsigned ssize_t or site_t.@n … … 630 630 while (true) { 631 631 i = nxt; 632 wchar_t uc = str_decode(fmt, &nxt, STR_NO_LIMIT);632 char32_t uc = str_decode(fmt, &nxt, STR_NO_LIMIT); 633 633 634 634 if (uc == 0) … … 789 789 case 's': 790 790 if (qualifier == PrintfQualifierLong) 791 retval = print_wstr(va_arg(ap, wchar_t *), width, precision, flags, ps);791 retval = print_wstr(va_arg(ap, char32_t *), width, precision, flags, ps); 792 792 else 793 793 retval = print_str(va_arg(ap, char *), width, precision, flags, ps);
Note:
See TracChangeset
for help on using the changeset viewer.