Changeset 11a4fbf in mainline for init/init.c


Ignore:
Timestamp:
2006-03-17T11:47:53Z (19 years ago)
Author:
Josef Cejka <malyzelenyhnus@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e5a1f82f
Parents:
c05290e
Message:

Userspace printf was rewritten to support standard format. Not all needed features implemented yet.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • init/init.c

    rc05290e r11a4fbf  
    4747        printf("Simple text.\n");
    4848        printf("Now insert '%s' string.\n","this");
    49         printf("We are brave enought to print numbers like %%d = '%d'\n", 0x123456);
    50         printf("And now... '%b' byte! '%w' word! '%W' Word! \n", 0x12, 0x1234, 0x1234);
    51         printf("'%Q' Q! Another '%q' q! \n", 0x1234567887654321ll, 0x1234567887654321ll);
    52         printf("'%Q' with 64bit value and '%p' with 32 bit value. \n", 0x1234567887654321ll, 0x12345678 );
    53         printf("'%Q' 64bit, '%p' 32bit, '%b' 8bit, '%w' 16bit, '%Q' 64bit and '%s' string.\n", 0x1234567887654321ll, 0x12345678, 0x12, 0x1234, 0x1234567887654321ull, "Lovely string" );
     49        printf("Signed formats on uns. numbers: '%d', '%+d', '% d', '%u' (,+, ,u)\n", 321, 321, 321, 321);
     50        printf("Signed formats on sig. numbers: '%d', '%+d', '% d', '%u' (,+, ,u)\n", -321, -321, -321, -321);
     51        printf("Signed with different sized: '%hhd', '%hd', '%d', '%ld', %lld;\n", -3, -32, -321, -32101l, -3210123ll);
     52        printf("And now... '%hhd' byte! '%hd' word! '%d' int! \n", 11, 11111, 1111111111);
     53        printf("Different bases: %#hx, %#hu, %#ho and %#hb\n", 123, 123, 123, 123);
     54        printf("Different bases signed: %#hx, %#hu, %#ho and %#hb\n", -123, -123, -123, -123);
     55        printf("'%llX' llX! Another '%llx' llx! \n", 0x1234567887654321ll, 0x1234567887654321ll);
     56        printf("'%llX' with 64bit value and '%x' with 32 bit value. \n", 0x1234567887654321ll, 0x12345678 );
     57        printf("'%llx' 64bit, '%x' 32bit, '%hhx' 8bit, '%hx' 16bit, '%llX' 64bit and '%s' string.\n", 0x1234567887654321ll, 0x12345678, 0x12, 0x1234, 0x1234567887654321ull, "Lovely string" );
    5458       
    5559        printf("Thats all, folks!\n");
     
    113117static void got_answer(void *private, int retval, ipc_data_t *data)
    114118{
    115         printf("Retval: %d...%s...%X, %X\n", retval, private,
     119        printf("Retval: %d...%s...%zX, %zX\n", retval, private,
    116120               IPC_GET_ARG1(*data), IPC_GET_ARG2(*data));
    117121}
     
    157161        printf("Asking 0 to connect to me...\n");
    158162        res = ipc_connect_to_me(0, 1, 2, &taskid);
    159         printf("Result: %d - taskid: %Q\n", res, taskid);
     163        printf("Result: %d - taskid: %llu\n", res, taskid);
    160164        for (i=0; i < 100; i++) {
    161165                printf("----------------\n");
     
    179183        printf("pinging.\n");
    180184        res = ipc_call_sync(res, NS_PING, 0xbeef,&result);
    181         printf("Retval: %d - received: %P\n", res, result);
     185        printf("Retval: %d - received: %zd\n", res, result);
    182186       
    183187}
Note: See TracChangeset for help on using the changeset viewer.