Changeset 7e752b2 in mainline for uspace/app
- Timestamp:
- 2010-11-26T01:33:20Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bf61d3a
- Parents:
- 202f57b
- Location:
- uspace/app
- Files:
-
- 20 edited
-
bdsh/cmds/modules/bdd/bdd.c (modified) (2 diffs)
-
bdsh/cmds/modules/cp/cp.c (modified) (4 diffs)
-
bdsh/cmds/modules/mkfile/mkfile.c (modified) (2 diffs)
-
bdsh/cmds/modules/unmount/unmount.c (modified) (2 diffs)
-
bdsh/exec.c (modified) (1 diff)
-
edit/edit.c (modified) (3 diffs)
-
netecho/netecho.c (modified) (4 diffs)
-
nettest1/nettest1.c (modified) (2 diffs)
-
nettest2/nettest2.c (modified) (3 diffs)
-
ping/ping.c (modified) (2 diffs)
-
stats/stats.c (modified) (1 diff)
-
taskdump/taskdump.c (modified) (9 diffs)
-
tasks/tasks.c (modified) (2 diffs)
-
test_serial/test_serial.c (modified) (2 diffs)
-
tester/ipc/ping_pong.c (modified) (1 diff)
-
tester/ipc/register.c (modified) (3 diffs)
-
tester/stdio/stdio1.c (modified) (1 diff)
-
tester/thread/thread1.c (modified) (2 diffs)
-
trace/ipcp.c (modified) (4 diffs)
-
trace/trace.c (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/bdd/bdd.c
r202f57b r7e752b2 30 30 #include <stdlib.h> 31 31 #include <str.h> 32 #include <sys/typefmt.h> 32 33 #include "config.h" 33 34 #include "util.h" … … 122 123 rc = block_read_direct(handle, ba, 1, blk); 123 124 if (rc != EOK) { 124 printf("%s: Error reading block % llu\n", cmdname, ba);125 printf("%s: Error reading block %" PRIuOFF64 "\n", cmdname, ba); 125 126 free(blk); 126 127 block_fini(handle); -
uspace/app/bdsh/cmds/modules/cp/cp.c
r202f57b r7e752b2 95 95 96 96 if (vb) 97 printf("% dbytes to copy\n", total);97 printf("%" PRIu64 " bytes to copy\n", total); 98 98 99 99 lseek(fd1, 0, SEEK_SET); … … 130 130 */ 131 131 if (res != 0) { 132 printf("\n% d more bytes than actually exist were copied\n", res);132 printf("\n%zd more bytes than actually exist were copied\n", res); 133 133 goto err; 134 134 } … … 187 187 return CMD_SUCCESS; 188 188 case 'v': 189 printf("% d\n", CP_VERSION);189 printf("%s\n", CP_VERSION); 190 190 return CMD_SUCCESS; 191 191 case 'V': … … 223 223 224 224 if (verbose) 225 printf("% dbytes copied\n", ret);225 printf("%" PRId64 " bytes copied\n", ret); 226 226 227 227 if (ret >= 0) -
uspace/app/bdsh/cmds/modules/mkfile/mkfile.c
r202f57b r7e752b2 168 168 rc = write(fd, buffer, to_write); 169 169 if (rc <= 0) { 170 printf("%s: Error writing file (% d).\n", cmdname, rc);170 printf("%s: Error writing file (%zd).\n", cmdname, rc); 171 171 close(fd); 172 172 return CMD_FAILURE; … … 177 177 rc = close(fd); 178 178 if (rc != 0) { 179 printf("%s: Error writing file (% d).\n", cmdname, rc);179 printf("%s: Error writing file (%zd).\n", cmdname, rc); 180 180 return CMD_FAILURE; 181 181 } -
uspace/app/bdsh/cmds/modules/unmount/unmount.c
r202f57b r7e752b2 47 47 } else { 48 48 help_cmd_unmount(HELP_SHORT); 49 printf("Usage: %s <mp>\n", cmdname);49 printf("Usage: %s <mp>\n", cmdname); 50 50 } 51 51 return; … … 68 68 rc = unmount(argv[1]); 69 69 if (rc != EOK) { 70 printf("Unable to unmount %s (rc=%d)\n", argv[1] );70 printf("Unable to unmount %s (rc=%d)\n", argv[1], rc); 71 71 return CMD_FAILURE; 72 72 } -
uspace/app/bdsh/exec.c
r202f57b r7e752b2 133 133 rc = task_wait(tid, &texit, &retval); 134 134 if (rc != EOK) { 135 printf("%s: Failed waiting for command (%s)\n", str_error(rc)); 135 printf("%s: Failed waiting for command (%s)\n", progname, 136 str_error(rc)); 136 137 } else if (texit != TASK_EXIT_NORMAL) { 137 138 printf("%s: Command failed (unexpectedly terminated)\n", progname); -
uspace/app/edit/edit.c
r202f57b r7e752b2 781 781 c = str_decode(row_buf, &pos, size); 782 782 if (c != '\t') { 783 printf("%lc", c);783 printf("%lc", (wint_t) c); 784 784 s_column += 1; 785 785 } else { … … 830 830 int n = printf(" %d, %d: File '%s'. Ctrl-Q Quit Ctrl-S Save " 831 831 "Ctrl-E Save As", coord.row, coord.column, fname); 832 printf("%*s", scr_columns - 1 - n, ""); 832 833 int pos = scr_columns - 1 - n; 834 printf("%*s", pos, ""); 833 835 fflush(stdout); 834 836 console_set_style(con, STYLE_NORMAL); … … 1153 1155 console_set_pos(con, 0, scr_rows - 1); 1154 1156 console_set_style(con, STYLE_INVERTED); 1155 printf(" %*s ", -(scr_columns - 3), str); 1157 1158 int pos = -(scr_columns - 3); 1159 printf(" %*s ", pos, str); 1156 1160 fflush(stdout); 1157 1161 console_set_style(con, STYLE_NORMAL); -
uspace/app/netecho/netecho.c
r202f57b r7e752b2 220 220 // check the buffer size 221 221 if (size <= 0) { 222 fprintf(stderr, "Receive size too small (% d). Using 1024 bytes instead.\n", size);222 fprintf(stderr, "Receive size too small (%zu). Using 1024 bytes instead.\n", size); 223 223 size = 1024; 224 224 } … … 262 262 // check the backlog 263 263 if (backlog <= 0) { 264 fprintf(stderr, "Accepted sockets queue size too small (% d). Using 3 instead.\n", size);264 fprintf(stderr, "Accepted sockets queue size too small (%zu). Using 3 instead.\n", size); 265 265 backlog = 3; 266 266 } … … 325 325 break; 326 326 default: 327 fprintf(stderr, "Address family %d (0x%X) is not supported.\n", address->sa_family); 327 fprintf(stderr, "Address family %u (%#x) is not supported.\n", 328 address->sa_family, address->sa_family); 328 329 } 329 330 // parse the source address … … 334 335 } else { 335 336 data[length] = '\0'; 336 printf("Socket %d received %d bytes from %s:%d\n%s\n", socket_id, length, address_string, port, data); 337 printf("Socket %d received %zu bytes from %s:%d\n%s\n", 338 socket_id, length, address_string, port, data); 337 339 } 338 340 } -
uspace/app/nettest1/nettest1.c
r202f57b r7e752b2 356 356 /* Check data buffer size */ 357 357 if (size <= 0) { 358 fprintf(stderr, "Data buffer size too small (% d). Using 1024 "358 fprintf(stderr, "Data buffer size too small (%zu). Using 1024 " 359 359 "bytes instead.\n", size); 360 360 size = 1024; … … 410 410 } 411 411 412 printf("Tested in % d microseconds\n", tv_sub(&time_after,412 printf("Tested in %ld microseconds\n", tv_sub(&time_after, 413 413 &time_before)); 414 414 -
uspace/app/nettest2/nettest2.c
r202f57b r7e752b2 302 302 /* Check data buffer size. */ 303 303 if (size <= 0) { 304 fprintf(stderr, "Data buffer size too small (% d). Using 1024 "304 fprintf(stderr, "Data buffer size too small (%zu). Using 1024 " 305 305 "bytes instead.\n", size); 306 306 size = 1024; … … 375 375 printf("\tOK\n"); 376 376 377 printf("sendto + recvfrom tested in % d microseconds\n",377 printf("sendto + recvfrom tested in %ld microseconds\n", 378 378 tv_sub(&time_after, &time_before)); 379 379 … … 403 403 printf("\tOK\n"); 404 404 405 printf("sendto, recvfrom tested in % d microseconds\n",405 printf("sendto, recvfrom tested in %ld microseconds\n", 406 406 tv_sub(&time_after, &time_before)); 407 407 -
uspace/app/ping/ping.c
r202f57b r7e752b2 337 337 } 338 338 339 printf("PING %s (%s) % u(%u) bytes of data\n", config.dest_addr,339 printf("PING %s (%s) %zu(%zu) bytes of data\n", config.dest_addr, 340 340 config.dest_str, config.size, config.size); 341 341 … … 378 378 switch (result) { 379 379 case ICMP_ECHO: 380 printf("% u bytes from ? (?): icmp_seq=%u ttl=? time=%u.%04u\n",380 printf("%zu bytes from ? (?): icmp_seq=%u ttl=? time=%ld.%04ld\n", 381 381 config.size, seq, elapsed / 1000, elapsed % 1000); 382 382 break; 383 383 case ETIMEOUT: 384 printf("% u bytes from ? (?): icmp_seq=%u Timed out\n",384 printf("%zu bytes from ? (?): icmp_seq=%u Timed out\n", 385 385 config.size, seq); 386 386 break; -
uspace/app/stats/stats.c
r202f57b r7e752b2 56 56 57 57 uint64_t sec = time.tv_sec; 58 printf("%02" PRIu64 ":%02" PRIu64 ":%02" PRIu64, (sec % DAY) / HOUR,59 (sec % HOUR) / MINUTE, sec % MINUTE);58 printf("%02" PRIu64 ":%02" PRIu64 ":%02" PRIu64, 59 (sec % DAY) / HOUR, (sec % HOUR) / MINUTE, sec % MINUTE); 60 60 61 61 sysarg_t uptime = stats_get_uptime(); 62 printf(", up %u days, %u hours, %u minutes, %u seconds", uptime / DAY, 63 (uptime % DAY) / HOUR, (uptime % HOUR) / MINUTE, uptime % MINUTE); 62 printf(", up %" PRIun " days, %" PRIun " hours, " 63 "%" PRIun " minutes, %" PRIun " seconds", 64 uptime / DAY, (uptime % DAY) / HOUR, 65 (uptime % HOUR) / MINUTE, uptime % MINUTE); 64 66 65 67 size_t count; -
uspace/app/taskdump/taskdump.c
r202f57b r7e752b2 85 85 rc = connect_task(task_id); 86 86 if (rc < 0) { 87 printf("Failed connecting to task %" PRI dTASKID".\n", task_id);87 printf("Failed connecting to task %" PRIu64 ".\n", task_id); 88 88 return 1; 89 89 } … … 92 92 app_symtab = NULL; 93 93 94 printf("Dumping task '%s' (task ID %" PRI dTASKID").\n", app_name, task_id);94 printf("Dumping task '%s' (task ID %" PRIu64 ").\n", app_name, task_id); 95 95 autoload_syms(); 96 96 putchar('\n'); … … 126 126 if (rc < 0) { 127 127 printf("Error connecting\n"); 128 printf("ipc_connect_task(%" PRI dTASKID") -> %d ", task_id, rc);128 printf("ipc_connect_task(%" PRIu64 ") -> %d ", task_id, rc); 129 129 return rc; 130 130 } … … 168 168 core_file_name = *argv; 169 169 } else { 170 printf("Uknown option '% s'\n", arg[0]);170 printf("Uknown option '%c'\n", arg[0]); 171 171 print_syntax(); 172 172 return -1; … … 240 240 printf("Threads:\n"); 241 241 for (i = 0; i < n_threads; i++) { 242 printf(" [% d] hash: %p\n", 1+i,thash_buf[i]);242 printf(" [%zu] hash: %p\n", 1 + i, (void *) thash_buf[i]); 243 243 244 244 thread_dump(thash_buf[i]); … … 284 284 printf("Address space areas:\n"); 285 285 for (i = 0; i < n_areas; i++) { 286 printf(" [% d] flags: %c%c%c%c base: %p size: %p\n", 1+i,286 printf(" [%zu] flags: %c%c%c%c base: %p size: %zu\n", 1 + i, 287 287 (ainfo_buf[i].flags & AS_AREA_READ) ? 'R' : '-', 288 288 (ainfo_buf[i].flags & AS_AREA_WRITE) ? 'W' : '-', 289 289 (ainfo_buf[i].flags & AS_AREA_EXEC) ? 'X' : '-', 290 290 (ainfo_buf[i].flags & AS_AREA_CACHEABLE) ? 'C' : '-', 291 ainfo_buf[i].start_addr, ainfo_buf[i].size);291 (void *) ainfo_buf[i].start_addr, ainfo_buf[i].size); 292 292 } 293 293 … … 326 326 327 327 sym_pc = fmt_sym_address(pc); 328 printf("Thread %p crashed at %s. FP = %p\n", thash, sym_pc, fp); 328 printf("Thread %p crashed at %s. FP = %p\n", (void *) thash, 329 sym_pc, (void *) fp); 329 330 free(sym_pc); 330 331 … … 334 335 while (stacktrace_fp_valid(&st, fp)) { 335 336 sym_pc = fmt_sym_address(pc); 336 printf(" %p: %s\n", fp, sym_pc);337 printf(" %p: %s\n", (void *) fp, sym_pc); 337 338 free(sym_pc); 338 339 … … 457 458 458 459 if (rc == EOK) { 459 rc = asprintf(&str, "%p (%s+% p)",addr, name, offs);460 rc = asprintf(&str, "%p (%s+%zu)", (void *) addr, name, offs); 460 461 } else { 461 rc = asprintf(&str, "%p", addr);462 rc = asprintf(&str, "%p", (void *) addr); 462 463 } 463 464 -
uspace/app/tasks/tasks.c
r202f57b r7e752b2 77 77 order_suffix(stats_tasks[i].kcycles, &kcycles, &ksuffix); 78 78 79 printf("%8" PRIu64 "%8 u %8" PRIu64"%c %12"79 printf("%8" PRIu64 "%8zu %8" PRIu64 "%c %12" 80 80 PRIu64 "%c %12" PRIu64 "%c %s\n", stats_tasks[i].task_id, 81 81 stats_tasks[i].threads, virtmem, vmsuffix, ucycles, usuffix, … … 160 160 } 161 161 162 printf("%s: % u CPU(s) detected\n", NAME, count);162 printf("%s: %zu CPU(s) detected\n", NAME, count); 163 163 164 164 size_t i; -
uspace/app/test_serial/test_serial.c
r202f57b r7e752b2 35 35 */ 36 36 37 #include <inttypes.h> 37 38 #include <errno.h> 38 39 #include <stdlib.h> … … 79 80 } 80 81 81 printf(NAME ": trying to read % d characters from device with handle "82 "% d.\n", cnt, handle);82 printf(NAME ": trying to read %ld characters from device with handle " 83 "%" PRIun ".\n", cnt, handle); 83 84 84 85 int phone = devman_device_connect(handle, IPC_FLAG_BLOCKING); -
uspace/app/tester/ipc/ping_pong.c
r202f57b r7e752b2 72 72 } 73 73 74 TPRINTF("OK\nCompleted % llu round trips in %u seconds, %llurt/s.\n",74 TPRINTF("OK\nCompleted %" PRIu64 " round trips in %u seconds, %" PRIu64 " rt/s.\n", 75 75 count, DURATION_SECS, count / DURATION_SECS); 76 76 -
uspace/app/tester/ipc/register.c
r202f57b r7e752b2 27 27 */ 28 28 29 #include <inttypes.h> 29 30 #include <stdio.h> 30 31 #include <unistd.h> … … 41 42 unsigned int i; 42 43 43 TPRINTF("Connected phone % #xaccepting\n", icall->in_phone_hash);44 TPRINTF("Connected phone %" PRIun " accepting\n", icall->in_phone_hash); 44 45 ipc_answer_0(iid, EOK); 45 46 for (i = 0; i < MAX_CONNECTIONS; i++) { … … 57 58 switch (IPC_GET_METHOD(call)) { 58 59 case IPC_M_PHONE_HUNGUP: 59 TPRINTF("Phone % #xhung up\n", icall->in_phone_hash);60 TPRINTF("Phone %" PRIun " hung up\n", icall->in_phone_hash); 60 61 retval = 0; 61 62 break; 62 63 case IPC_TEST_METHOD: 63 TPRINTF("Received well known message from % #x: %#x\n",64 TPRINTF("Received well known message from %" PRIun ": %" PRIun "\n", 64 65 icall->in_phone_hash, callid); 65 66 ipc_answer_0(callid, EOK); 66 67 break; 67 68 default: 68 TPRINTF("Received unknown message from % #x: %#x\n",69 TPRINTF("Received unknown message from %" PRIun ": %" PRIun "\n", 69 70 icall->in_phone_hash, callid); 70 71 ipc_answer_0(callid, ENOENT); -
uspace/app/tester/stdio/stdio1.c
r202f57b r7e752b2 60 60 61 61 buf[cnt] = '\0'; 62 TPRINTF("Read % u bytes, string \"%s\"\n", cnt, buf);62 TPRINTF("Read %zu bytes, string \"%s\"\n", cnt, buf); 63 63 64 64 TPRINTF("Seek to beginning..."); -
uspace/app/tester/thread/thread1.c
r202f57b r7e752b2 35 35 #include <stdio.h> 36 36 #include <unistd.h> 37 #include <inttypes.h> 37 38 #include "../tester.h" 38 39 … … 74 75 atomic_set(&finish, 0); 75 76 while (atomic_get(&threads_finished) < total) { 76 TPRINTF("Threads left: %u\n", total - atomic_get(&threads_finished)); 77 TPRINTF("Threads left: %" PRIua "\n", 78 total - atomic_get(&threads_finished)); 77 79 sleep(1); 78 80 } -
uspace/app/trace/ipcp.c
r202f57b r7e752b2 137 137 138 138 if (oper != NULL) { 139 printf("%s (% ld)", oper->name, method);139 printf("%s (%" PRIun ")", oper->name, method); 140 140 return; 141 141 } 142 142 143 printf("% ld", method);143 printf("%" PRIun, method); 144 144 } 145 145 … … 201 201 202 202 if ((display_mask & DM_IPC) != 0) { 203 printf("Call ID: %p, phone: %d, proto: %s, method: ", hash, 204 phone, (proto ? proto->name : "n/a")); 203 printf("Call ID: %p, phone: %d, proto: %s, method: ", 204 (void *) hash, phone, 205 (proto ? proto->name : "n/a")); 205 206 ipc_m_print(proto, IPC_GET_METHOD(*call)); 206 printf(" args: (%" PRIu IPCARG ", %" PRIuIPCARG ", %" PRIuIPCARG207 " , %" PRIuIPCARG ", %" PRIuIPCARG ")\n", args[1], args[2],208 args[ 3], args[4], args[5]);207 printf(" args: (%" PRIun ", %" PRIun ", %" PRIun ", " 208 "%" PRIun ", %" PRIun ")\n", 209 args[1], args[2], args[3], args[4], args[5]); 209 210 } 210 211 … … 281 282 282 283 if ((display_mask & DM_IPC) != 0) { 283 printf("Response to %p: retval=%ld, args = (%" PRIuIPCARG 284 ", %" PRIuIPCARG ", %" PRIuIPCARG ", %" PRIuIPCARG 285 ", %" PRIuIPCARG ")\n", 286 hash, retval, IPC_GET_ARG1(*answer), 284 printf("Response to %p: retval=%" PRIdn ", args = (%" PRIun ", " 285 "%" PRIun ", %" PRIun ", %" PRIun ", %" PRIun ")\n", 286 (void *) hash, retval, IPC_GET_ARG1(*answer), 287 287 IPC_GET_ARG2(*answer), IPC_GET_ARG3(*answer), 288 288 IPC_GET_ARG4(*answer), IPC_GET_ARG5(*answer)); … … 340 340 /* Not a response */ 341 341 if ((display_mask & DM_IPC) != 0) { 342 printf("Not a response (hash %p)\n", hash);342 printf("Not a response (hash %p)\n", (void *) hash); 343 343 } 344 344 return; -
uspace/app/trace/trace.c
r202f57b r7e752b2 161 161 if (rc < 0) { 162 162 printf("Error connecting\n"); 163 printf("ipc_connect_task(%" PRI dTASKID") -> %d ", task_id, rc);163 printf("ipc_connect_task(%" PRIu64 ") -> %d ", task_id, rc); 164 164 return rc; 165 165 } … … 200 200 printf("Threads:"); 201 201 for (i = 0; i < n_threads; i++) { 202 printf(" [%d] (hash %p)", 1 +i,thread_hash_buf[i]);203 } 204 printf("\ntotal of % u threads\n", tb_needed / sizeof(uintptr_t));202 printf(" [%d] (hash %p)", 1 + i, (void *) thread_hash_buf[i]); 203 } 204 printf("\ntotal of %zu threads\n", tb_needed / sizeof(uintptr_t)); 205 205 206 206 return 0; … … 224 224 case V_HASH: 225 225 case V_PTR: 226 printf("%p", val);226 printf("%p", (void *) val); 227 227 break; 228 228 … … 248 248 case V_CHAR: 249 249 if (sval >= 0x20 && sval < 0x7f) { 250 printf("'%c'", sval);250 printf("'%c'", (char) sval); 251 251 } else { 252 252 switch (sval) { … … 257 257 case '\t': printf("'\\t'"); break; 258 258 case '\\': printf("'\\\\'"); break; 259 default: printf("'\\x%02 lX'", val); break;259 default: printf("'\\x%02" PRIxn "'", val); break; 260 260 } 261 261 } … … 277 277 278 278 putchar('('); 279 if (n > 0) printf("%" PRI dSYSARG, sc_args[0]);279 if (n > 0) printf("%" PRIun, sc_args[0]); 280 280 for (i = 1; i < n; i++) { 281 printf(", %" PRI dSYSARG, sc_args[i]);281 printf(", %" PRIun, sc_args[i]); 282 282 } 283 283 putchar(')'); … … 489 489 { 490 490 async_serialize_start(); 491 printf("New thread, hash 0x%lx\n",hash);491 printf("New thread, hash %p\n", (void *) hash); 492 492 async_serialize_end(); 493 493 … … 510 510 } 511 511 512 printf("Start tracing thread [%d] (hash %p).\n", thread_id, thread_hash); 512 printf("Start tracing thread [%u] (hash %p).\n", 513 thread_id, (void *) thread_hash); 513 514 514 515 while (!abort_trace) { … … 516 517 fibril_mutex_lock(&state_lock); 517 518 if (paused) { 518 printf("Thread [% d] paused. Press R to resume.\n",519 printf("Thread [%u] paused. Press R to resume.\n", 519 520 thread_id); 520 521 … … 522 523 fibril_condvar_wait(&state_cv, &state_lock); 523 524 524 printf("Thread [% d] resumed.\n", thread_id);525 printf("Thread [%u] resumed.\n", thread_id); 525 526 } 526 527 fibril_mutex_unlock(&state_lock); … … 554 555 break; 555 556 case UDEBUG_EVENT_THREAD_E: 556 printf("Thread % pexited.\n", val0);557 printf("Thread %" PRIun " exited.\n", val0); 557 558 fibril_mutex_lock(&state_lock); 558 559 abort_trace = true; … … 927 928 } 928 929 } else { 929 printf("Uknown option '% s'\n", arg[0]);930 printf("Uknown option '%c'\n", arg[0]); 930 931 print_syntax(); 931 932 return -1; … … 984 985 rc = connect_task(task_id); 985 986 if (rc < 0) { 986 printf("Failed connecting to task %" PRI dTASKID".\n", task_id);987 printf("Failed connecting to task %" PRIu64 ".\n", task_id); 987 988 return 1; 988 989 } 989 990 990 printf("Connected to task %" PRI dTASKID".\n", task_id);991 printf("Connected to task %" PRIu64 ".\n", task_id); 991 992 992 993 if (task_ldr != NULL)
Note:
See TracChangeset
for help on using the changeset viewer.
