Changeset 2afb650 in mainline
- Timestamp:
- 2010-05-04T11:07:11Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ae4235c
- Parents:
- 4940ea9
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
boot/generic/src/printf_core.c
r4940ea9 r2afb650 82 82 } qualifier_t; 83 83 84 static const char nullstr[]= "(NULL)";85 static const char digits_small[]= "0123456789abcdef";86 static const char digits_big[]= "0123456789ABCDEF";84 static const char *nullstr = "(NULL)"; 85 static const char *digits_small = "0123456789abcdef"; 86 static const char *digits_big = "0123456789ABCDEF"; 87 87 static const char invalch = U_SPECIAL; 88 88 … … 218 218 219 219 return ((int) counter); 220 221 220 } 222 221 -
kernel/generic/src/printf/printf_core.c
r4940ea9 r2afb650 261 261 if (str == NULL) 262 262 return printf_putstr(nullstr, ps); 263 263 264 264 /* Print leading spaces. */ 265 265 size_t strw = str_length(str); 266 266 if (precision == 0) 267 267 precision = strw; 268 268 269 269 /* Left padding */ 270 270 size_t counter = 0; … … 276 276 } 277 277 } 278 278 279 279 /* Part of @a str fitting into the alloted space. */ 280 280 int retval; … … 391 391 */ 392 392 if (flags & __PRINTF_FLAG_PREFIX) { 393 switch (base) {393 switch (base) { 394 394 case 2: 395 395 /* Binary formating is not standard, but usefull */ … … 455 455 /* Print prefix */ 456 456 if (flags & __PRINTF_FLAG_PREFIX) { 457 switch (base) {457 switch (base) { 458 458 case 2: 459 459 /* Binary formating is not standard, but usefull */ … … 570 570 * 571 571 * - P, p Print value of a pointer. Void * value is expected and it is 572 * printed in hexadecimal notation with prefix (as with \%#X / \%#x 573 * for 32-bit or \%#X / \%#x for 64-bit long pointers). 572 * printed in hexadecimal notation with prefix (as with 573 * \%#0.8X / \%#0.8x for 32-bit or \%#0.16lX / \%#0.16lx for 64-bit 574 * long pointers). 574 575 * 575 576 * - b Print value as unsigned binary number. Prefix is not printed by … … 784 785 case 'p': 785 786 flags |= __PRINTF_FLAG_PREFIX; 787 flags |= __PRINTF_FLAG_ZEROPADDED; 786 788 base = 16; 787 789 qualifier = PrintfQualifierPointer; … … 846 848 case PrintfQualifierPointer: 847 849 size = sizeof(void *); 848 number = (uint64_t) (unsigned long) va_arg(ap, void *); 850 precision = size << 1; 851 number = (uint64_t) (uintptr_t) va_arg(ap, void *); 849 852 break; 850 853 default: -
uspace/lib/c/generic/io/printf_core.c
r4940ea9 r2afb650 260 260 if (str == NULL) 261 261 return printf_putstr(nullstr, ps); 262 262 263 263 /* Print leading spaces. */ 264 264 size_t strw = str_length(str); 265 265 if (precision == 0) 266 266 precision = strw; 267 267 268 268 /* Left padding */ 269 269 size_t counter = 0; … … 275 275 } 276 276 } 277 277 278 278 /* Part of @a str fitting into the alloted space. */ 279 279 int retval; … … 390 390 */ 391 391 if (flags & __PRINTF_FLAG_PREFIX) { 392 switch (base) {392 switch (base) { 393 393 case 2: 394 394 /* Binary formating is not standard, but usefull */ … … 454 454 /* Print prefix */ 455 455 if (flags & __PRINTF_FLAG_PREFIX) { 456 switch (base) {456 switch (base) { 457 457 case 2: 458 458 /* Binary formating is not standard, but usefull */ … … 569 569 * 570 570 * - P, p Print value of a pointer. Void * value is expected and it is 571 * printed in hexadecimal notation with prefix (as with \%#X / \%#x 572 * for 32-bit or \%#X / \%#x for 64-bit long pointers). 571 * printed in hexadecimal notation with prefix (as with 572 * \%#0.8X / \%#0.8x for 32-bit or \%#0.16lX / \%#0.16lx for 64-bit 573 * long pointers). 573 574 * 574 575 * - b Print value as unsigned binary number. Prefix is not printed by … … 783 784 case 'p': 784 785 flags |= __PRINTF_FLAG_PREFIX; 786 flags |= __PRINTF_FLAG_ZEROPADDED; 785 787 base = 16; 786 788 qualifier = PrintfQualifierPointer; … … 845 847 case PrintfQualifierPointer: 846 848 size = sizeof(void *); 847 number = (uint64_t) (unsigned long) va_arg(ap, void *); 849 precision = size << 1; 850 number = (uint64_t) (uintptr_t) va_arg(ap, void *); 848 851 break; 849 852 default:
Note:
See TracChangeset
for help on using the changeset viewer.