Changeset 0b0f4bb in mainline
- Timestamp:
- 2010-11-26T01:28:09Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 062fde4
- Parents:
- 9ac2013
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/console/cmd.c
r9ac2013 r0b0f4bb 554 554 } 555 555 556 unsigned int _len = (unsigned int) len; 557 if ((_len != len) || (((int) _len) < 0)) { 558 printf("Command length overflow\n"); 559 return 1; 560 } 561 556 562 for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) { 557 563 cmd_info_t *hlp; … … 559 565 560 566 spinlock_lock(&hlp->lock); 561 printf("%-*s %s\n", len, hlp->name, hlp->description);567 printf("%-*s %s\n", _len, hlp->name, hlp->description); 562 568 spinlock_unlock(&hlp->lock); 563 569 } … … 668 674 fnc = (unative_t (*)(void)) arch_construct_function(&fptr, 669 675 (void *) symaddr, (void *) cmd_call0); 670 printf("Calling %s() (%p)\n", symbol, symaddr);676 printf("Calling %s() (%p)\n", symbol, (void *) symaddr); 671 677 printf("Result: %#" PRIxn "\n", fnc()); 672 678 interrupts_restore(ipl); … … 685 691 */ 686 692 687 size_t i;693 unsigned int i; 688 694 for (i = 0; i < config.cpu_count; i++) { 689 695 if (!cpus[i].active) … … 697 703 irq_spinlock_unlock(&thread->lock, true); 698 704 699 printf("cpu% " PRIs ": ", i);705 printf("cpu%u: ", i); 700 706 701 707 thread_ready(thread); … … 703 709 thread_detach(thread); 704 710 } else 705 printf("Unable to create thread for cpu% " PRIs "\n", i);711 printf("Unable to create thread for cpu%u\n", i); 706 712 } 707 713 … … 731 737 732 738 ipl = interrupts_disable(); 733 fnc = (unative_t (*)(unative_t, ...)) arch_construct_function(&fptr, (void *) symaddr, (void *) cmd_call1); 734 printf("Calling f(%#" PRIxn "): %p: %s\n", arg1, symaddr, symbol); 739 fnc = (unative_t (*)(unative_t, ...)) 740 arch_construct_function(&fptr, (void *) symaddr, 741 (void *) cmd_call1); 742 printf("Calling f(%#" PRIxn "): %p: %s\n", arg1, 743 (void *) symaddr, symbol); 735 744 printf("Result: %#" PRIxn "\n", fnc(arg1)); 736 745 interrupts_restore(ipl); … … 765 774 766 775 ipl = interrupts_disable(); 767 fnc = (unative_t (*)(unative_t, unative_t, ...)) arch_construct_function(&fptr, (void *) symaddr, (void *) cmd_call2); 776 fnc = (unative_t (*)(unative_t, unative_t, ...)) 777 arch_construct_function(&fptr, (void *) symaddr, 778 (void *) cmd_call2); 768 779 printf("Calling f(%#" PRIxn ", %#" PRIxn "): %p: %s\n", 769 arg1, arg2, symaddr, symbol);780 arg1, arg2, (void *) symaddr, symbol); 770 781 printf("Result: %#" PRIxn "\n", fnc(arg1, arg2)); 771 782 interrupts_restore(ipl); … … 800 811 801 812 ipl = interrupts_disable(); 802 fnc = (unative_t (*)(unative_t, unative_t, unative_t, ...)) arch_construct_function(&fptr, (void *) symaddr, (void *) cmd_call3); 803 printf("Calling f(%#" PRIxn ",%#" PRIxn ", %#" PRIxn "): %p: %s\n", 804 arg1, arg2, arg3, symaddr, symbol); 813 fnc = (unative_t (*)(unative_t, unative_t, unative_t, ...)) 814 arch_construct_function(&fptr, (void *) symaddr, 815 (void *) cmd_call3); 816 printf("Calling f(%#" PRIxn ",%#" PRIxn ", %#" PRIxn "): %p: %s\n", 817 arg1, arg2, arg3, (void *) symaddr, symbol); 805 818 printf("Result: %#" PRIxn "\n", fnc(arg1, arg2, arg3)); 806 819 interrupts_restore(ipl); … … 875 888 876 889 if (rc == ENOENT) 877 printf("Symbol %s not found.\n", argv->buffer);890 printf("Symbol %s not found.\n", (char *) argv->buffer); 878 891 else if (rc == EINVAL) 879 892 printf("Invalid address.\n"); … … 884 897 if (pointer) 885 898 addr = *(uintptr_t *) addr; 886 printf("Writing %#" PRIx 64 " -> %p\n", arg1,addr);899 printf("Writing %#" PRIx32" -> %p\n", arg1, (void *) addr); 887 900 *(uint32_t *) addr = arg1; 888 901 } else … … 1172 1185 } 1173 1186 1187 unsigned int _len = (unsigned int) len; 1188 if ((_len != len) || (((int) _len) < 0)) { 1189 printf("Command length overflow\n"); 1190 return; 1191 } 1192 1174 1193 for (test = tests; test->name != NULL; test++) 1175 printf("%-*s %s%s\n", len, test->name, test->desc, (test->safe ? "" : " (unsafe)")); 1176 1177 printf("%-*s Run all safe tests\n", len, "*"); 1194 printf("%-*s %s%s\n", _len, test->name, test->desc, 1195 (test->safe ? "" : " (unsafe)")); 1196 1197 printf("%-*s Run all safe tests\n", _len, "*"); 1178 1198 } 1179 1199 -
uspace/app/tester/vfs/vfs1.c
r9ac2013 r0b0f4bb 105 105 if (cnt < 0) 106 106 return "write() failed"; 107 TPRINTF("Written % d bytes\n", cnt);107 TPRINTF("Written %zd bytes\n", cnt); 108 108 109 109 if (lseek(fd0, 0, SEEK_SET) != 0) … … 116 116 return "read() failed"; 117 117 118 TPRINTF("Read %d bytes: \".*s\"\n", cnt, cnt, buf); 118 int _cnt = (int) cnt; 119 if (_cnt != cnt) { 120 /* Count overflow, just to be sure. */ 121 TPRINTF("Read %zd bytes\n", cnt); 122 } else { 123 TPRINTF("Read %zd bytes: \"%.*s\"\n", cnt, _cnt, buf); 124 } 119 125 } 120 126 -
uspace/app/top/screen.c
r9ac2013 r0b0f4bb 150 150 screen_get_pos(&c, &r); 151 151 152 if (c < cols) 153 printf("%.*s", cols - c - 1, str); 152 if (c < cols) { 153 int pos = cols - c - 1; 154 printf("%.*s", pos, str); 155 } 154 156 } 155 157 156 158 static inline void print_global_head(data_t *data) 157 159 { 158 printf("top - %02lu:%02lu:%02lu up %u days, %02u:%02u:%02u, load average:", 160 printf("top - %02lu:%02lu:%02lu up " 161 "%" PRIun " days, %02" PRIun ":%02" PRIun ":%02" PRIun ", " 162 "load average:", 159 163 data->hours, data->minutes, data->seconds, 160 164 data->udays, data->uhours, data->uminutes, data->useconds); … … 171 175 static inline void print_task_summary(data_t *data) 172 176 { 173 printf("tasks: % u total", data->tasks_count);177 printf("tasks: %zu total", data->tasks_count); 174 178 screen_newline(); 175 179 } … … 211 215 } 212 216 213 printf("threads: % u total, %u running, %u ready, %u sleeping, %u lingering, "214 "% u other, %u invalid",217 printf("threads: %zu total, %zu running, %zu ready, " 218 "%zu sleeping, %zu lingering, %zu other, %zu invalid", 215 219 total, running, ready, sleeping, lingering, other, invalid); 216 220 screen_newline(); … … 295 299 order_suffix(task->virtmem, &virtmem, &virtmem_suffix); 296 300 297 printf("%-8" PRIu64 " %9 u %8" PRIu64 "%c ", task->task_id,301 printf("%-8" PRIu64 " %9zu %8" PRIu64 "%c ", task->task_id, 298 302 task->threads, virtmem, virtmem_suffix); 299 303 print_percent(perc->virtmem, 2);
Note:
See TracChangeset
for help on using the changeset viewer.