Changeset 523fad8 in mainline


Ignore:
Timestamp:
2006-04-16T13:18:43Z (19 years ago)
Author:
Josef Cejka <malyzelenyhnus@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
da32cea
Parents:
9426c1a3
Message:

Bugfix in printf, some support for testing.

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • init/init.c

    r9426c1a3 r523fad8  
    5858}
    5959
     60/* test different parameters types and modifiers */
    6061static void test_printf(void)
    6162{
     
    7576}
    7677
     78/* test width and precision modifiers */
     79static void test_printf2(void)
     80{
     81        printf(" text 10.8s %*.*s \n", 5, 3, "text");
     82        printf(" very long text 10.8s %10.8s \n", "very long text");
     83        printf(" text 8.10s %8.10s \n", "text");
     84        printf(" very long text 8.10s %8.10s \n", "very long text");
     85
     86        printf(" char: c '%c', 3.2c '%3.2c', -3.2c '%-3.2c', 2.3c '%2.3c', -2.3c '%-2.3c' \n",'a', 'b', 'c', 'd', 'e' );
     87        printf(" int: d '%d', 3.2d '%3.2d', -3.2d '%-3.2d', 2.3d '%2.3d', -2.3d '%-2.3d' \n",1, 1, 1, 1, 1 );
     88        printf(" -int: d '%d', 3.2d '%3.2d', -3.2d '%-3.2d', 2.3d '%2.3d', -2.3d '%-2.3d' \n",-1, -1, -1, -1, -1 );
     89        printf(" 0xint: x '%x', 5.3x '%#5.3x', -5.3x '%#-5.3x', 3.5x '%#3.5x', -3.5x '%#-3.5x' \n",17, 17, 17, 17, 17 );
     90
     91}
    7792
    7893extern char _heap;
     
    279294        pstid_t ptid;
    280295        int tid;
    281 
     296       
    282297        version_print();
    283298
    284299//      test_printf();
     300//      test_printf2();
    285301//      test_ping();
    286302//      test_async_ipc();
  • libc/generic/io/print.c

    r9426c1a3 r523fad8  
    6969 * @return number of printed characters or EOF
    7070 */
    71                                                
    7271static int print_char(char c, int width, uint64_t flags)
    7372{
    7473        int counter = 0;
    75         char space = ' ';
    7674       
    7775        if (!(flags & __PRINTF_FLAG_LEFTALIGNED)) {
     
    257255                                        putchar('b');
    258256                                }
    259                                 written == 2;
     257                                written += 2;
    260258                                break;
    261259                        case 8:
  • libc/generic/string.c

    r9426c1a3 r523fad8  
    5050size_t strlen(const char *str)
    5151{
    52         int counter = 0;
     52        size_t counter = 0;
    5353
    5454        while (str[counter] != 0) {
Note: See TracChangeset for help on using the changeset viewer.