Changeset 93a3348 in mainline for kernel/generic/src/printf/printf_core.c
 Timestamp:
 20080603T14:48:07Z (16 years ago)
 Branches:
 lfn, master, serial, ticket/834toolchainupdate, topic/msimupgrade, topic/simplifydevexport
 Children:
 8ed4014
 Parents:
 2b8b0ca
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

kernel/generic/src/printf/printf_core.c
r2b8b0ca r93a3348 76 76 PrintfQualifierLong, 77 77 PrintfQualifierLongLong, 78 PrintfQualifierNative,79 78 PrintfQualifierPointer 80 79 } qualifier_t; … … 433 432 *  "l" Signed or unsigned long int.@n 434 433 *  "ll" Signed or unsigned long long int.@n 435 *  "z" unative_t (nonstandard extension).@n436 434 * 437 435 * … … 487 485 while ((c = fmt[i])) { 488 486 /* control character */ 489 if (c == '%' 487 if (c == '%') { 490 488 /* print common characters if any processed */ 491 489 if (i > j) { … … 537 535 /* get width value from argument list */ 538 536 i++; 539 width = (int) va_arg(ap, int);537 width = (int) va_arg(ap, int); 540 538 if (width < 0) { 541 539 /* negative width sets '' flag */ … … 560 558 */ 561 559 i++; 562 precision = (int) va_arg(ap, int);560 precision = (int) va_arg(ap, int); 563 561 if (precision < 0) { 564 562 /* ignore negative precision */ … … 585 583 qualifier = PrintfQualifierLongLong; 586 584 } 587 break;588 case 'z': /* unative_t */589 qualifier = PrintfQualifierNative;590 585 break; 591 586 default: … … 628 623 */ 629 624 case 'P': /* pointer */ 630 625 flags = __PRINTF_FLAG_BIGCHARS; 631 626 case 'p': 632 627 flags = __PRINTF_FLAG_PREFIX; … … 671 666 case PrintfQualifierByte: 672 667 size = sizeof(unsigned char); 673 number = (uint64_t) va_arg(ap, unsigned int);668 number = (uint64_t) va_arg(ap, unsigned int); 674 669 break; 675 670 case PrintfQualifierShort: 676 671 size = sizeof(unsigned short); 677 number = (uint64_t) va_arg(ap, unsigned int);672 number = (uint64_t) va_arg(ap, unsigned int); 678 673 break; 679 674 case PrintfQualifierInt: 680 675 size = sizeof(unsigned int); 681 number = (uint64_t) va_arg(ap, unsigned int);676 number = (uint64_t) va_arg(ap, unsigned int); 682 677 break; 683 678 case PrintfQualifierLong: 684 679 size = sizeof(unsigned long); 685 number = (uint64_t) va_arg(ap, unsigned long);680 number = (uint64_t) va_arg(ap, unsigned long); 686 681 break; 687 682 case PrintfQualifierLongLong: 688 683 size = sizeof(unsigned long long); 689 number = (uint64_t)va_arg(ap, 690 unsigned long long); 684 number = (uint64_t) va_arg(ap, unsigned long long); 691 685 break; 692 686 case PrintfQualifierPointer: 693 687 size = sizeof(void *); 694 number = (uint64_t)(unsigned long)va_arg(ap, 695 void *); 696 break; 697 case PrintfQualifierNative: 698 size = sizeof(unative_t); 699 number = (uint64_t)va_arg(ap, unative_t); 688 number = (uint64_t) (unsigned long) va_arg(ap, void *); 700 689 break; 701 690 default: /* Unknown qualifier */ … … 709 698 710 699 if (size == sizeof(uint64_t)) { 711 number = ((int64_t) number);700 number = ((int64_t) number); 712 701 } else { 713 702 number = ~number; … … 735 724 736 725 if (i > j) { 737 if ((retval = printf_putnchars(&fmt[j], (unative_t) (i  j),726 if ((retval = printf_putnchars(&fmt[j], (unative_t) (i  j), 738 727 ps)) < 0) { /* error */ 739 728 counter = counter; … … 745 734 746 735 out: 747 748 736 return counter; 749 737 }
Note:
See TracChangeset
for help on using the changeset viewer.