Changeset 1b0b48e0 in mainline for kernel/generic/src/printf/vprintf.c
- Timestamp:
- 2009-04-01T19:01:39Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 06b785f
- Parents:
- f25b2819
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/printf/vprintf.c
rf25b2819 r1b0b48e0 46 46 static int vprintf_write_utf8(const char *str, size_t size, void *data) 47 47 { 48 index_t index= 0;49 index_t chars = 0;50 51 while ( index< size) {52 putchar(chr_decode(str, & index, size));48 size_t offset = 0; 49 count_t chars = 0; 50 51 while (offset < size) { 52 putchar(chr_decode(str, &offset, size)); 53 53 chars++; 54 54 } 55 55 56 56 return chars; 57 57 } … … 60 60 { 61 61 index_t index = 0; 62 62 63 63 while (index < (size / sizeof(wchar_t))) { 64 64 putchar(str[index]); 65 65 index++; 66 66 } 67 67 68 68 return index; 69 69 } … … 71 71 int puts(const char *str) 72 72 { 73 index_t index= 0;74 index_t chars = 0;73 size_t offset = 0; 74 count_t chars = 0; 75 75 wchar_t uc; 76 77 while ((uc = chr_decode(str, & index, UTF8_NO_LIMIT)) != 0) {76 77 while ((uc = chr_decode(str, &offset, UTF8_NO_LIMIT)) != 0) { 78 78 putchar(uc); 79 79 chars++; 80 80 } 81 81 82 82 return chars; 83 83 } … … 90 90 NULL 91 91 }; 92 92 93 93 ipl_t ipl = interrupts_disable(); 94 94 spinlock_lock(&printf_lock); 95 95 96 96 int ret = printf_core(fmt, &ps, ap); 97 97 98 98 spinlock_unlock(&printf_lock); 99 99 interrupts_restore(ipl); 100 100 101 101 return ret; 102 102 }
Note:
See TracChangeset
for help on using the changeset viewer.