Changeset 280a27e in mainline for test/print/print1/test.c


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

Printf ported back from uspace to kernel.
Printf calls changed to match new conventions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/print/print1/test.c

    rc624b96 r280a27e  
    3131void test(void)
    3232{
     33        __native nat = 0x12345678u;
    3334        printf(" Printf test \n");
    34         printf(" Q  %Q  %q \n",0x1111111111111111ull, 0x2222222222222222ull);
    35         printf(" Q,l  %Q  %l \n", 0x3333333333333333ull, 0x01234567);
    36         printf(" l,Q  %l  %Q \n", 0x01234567, 0x4444444444444444ull);
    37         printf(" L  %L  %l \n",0x01234567 ,0x01234567);   
    38         printf(" W  %W  %w \n",0x0123 ,0x0123);   
    39         printf(" B  %B  %b \n",0x01 ,0x01);
     35       
     36        printf(" text 10.8s %*.*s \n", 5, 3, "text");
     37        printf(" very long text 10.8s %10.8s \n", "very long text");
     38        printf(" text 8.10s %8.10s \n", "text");
     39        printf(" very long text 8.10s %8.10s \n", "very long text");
     40
     41        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' );
     42        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 );
     43        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 );
     44        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 );
     45
     46        printf("'%#llx' 64bit, '%#x' 32bit, '%#hhx' 8bit, '%#hx' 16bit, __native '%#zX'. '%#llX' 64bit and '%s' string.\n", 0x1234567887654321ll, 0x12345678, 0x12, 0x1234, nat, 0x1234567887654321ull, "Lovely string" );
     47       
    4048        printf(" Print to NULL '%s'\n",NULL);
    4149        return;
Note: See TracChangeset for help on using the changeset viewer.