Changeset 28a5ebd in mainline for uspace/lib/c/generic/io/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
-
uspace/lib/c/generic/io/printf_core.c
r4f663f3e r28a5ebd 47 47 #include <assert.h> 48 48 #include <macros.h> 49 #include < wchar.h>49 #include <uchar.h> 50 50 51 51 /** show prefixes 0x or 0 */ … … 187 187 * 188 188 */ 189 static int printf_wputnchars(const wchar_t *buf, size_t size,189 static int printf_wputnchars(const char32_t *buf, size_t size, 190 190 printf_spec_t *ps) 191 191 { … … 233 233 * 234 234 */ 235 static int printf_put wchar(const wchar_t ch, printf_spec_t *ps)235 static int printf_putuchar(const char32_t ch, printf_spec_t *ps) 236 236 { 237 237 if (!chr_check(ch)) 238 238 return ps->str_write((void *) &invalch, 1, ps->data); 239 239 240 return ps->wstr_write(&ch, sizeof( wchar_t), ps->data);240 return ps->wstr_write(&ch, sizeof(char32_t), ps->data); 241 241 } 242 242 … … 288 288 * 289 289 */ 290 static int print_wchar(const wchar_t ch, int width, uint32_t flags, printf_spec_t *ps)290 static int print_wchar(const char32_t ch, int width, uint32_t flags, printf_spec_t *ps) 291 291 { 292 292 size_t counter = 0; … … 302 302 } 303 303 304 if (printf_put wchar(ch, ps) > 0)304 if (printf_putuchar(ch, ps) > 0) 305 305 counter++; 306 306 … … 375 375 * @return Number of wide characters printed, negative value on failure. 376 376 */ 377 static int print_wstr( wchar_t *str, int width, unsigned int precision,377 static int print_wstr(char32_t *str, int width, unsigned int precision, 378 378 uint32_t flags, printf_spec_t *ps) 379 379 { … … 1276 1276 * - "l" Signed or unsigned long int.@n 1277 1277 * If conversion is "c", the character is wint_t (wide character).@n 1278 * If conversion is "s", the string is wchar_t * (wide string).@n1278 * If conversion is "s", the string is char32_t * (wide string).@n 1279 1279 * - "ll" Signed or unsigned long long int.@n 1280 1280 * - "z" Signed or unsigned ssize_t or site_t.@n … … 1330 1330 while (true) { 1331 1331 i = nxt; 1332 wchar_t uc = str_decode(fmt, &nxt, STR_NO_LIMIT);1332 char32_t uc = str_decode(fmt, &nxt, STR_NO_LIMIT); 1333 1333 1334 1334 if (uc == 0) … … 1493 1493 1494 1494 if (qualifier == PrintfQualifierLong) 1495 retval = print_wstr(va_arg(ap, wchar_t *), width, precision, flags, ps);1495 retval = print_wstr(va_arg(ap, char32_t *), width, precision, flags, ps); 1496 1496 else 1497 1497 retval = print_str(va_arg(ap, char *), width, precision, flags, ps);
Note:
See TracChangeset
for help on using the changeset viewer.