Changes in uspace/app/top/screen.c [96b02eb9:172aad6] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/top/screen.c
r96b02eb9 r172aad6 47 47 #include "top.h" 48 48 49 static sysarg_t warn_col = 0;50 static sysarg_t warn_row = 0;49 static ipcarg_t warn_col = 0; 50 static ipcarg_t warn_row = 0; 51 51 52 52 static void screen_style_normal(void) … … 62 62 } 63 63 64 static void screen_moveto( sysarg_t col, sysarg_t row)64 static void screen_moveto(ipcarg_t col, ipcarg_t row) 65 65 { 66 66 fflush(stdout); … … 68 68 } 69 69 70 static void screen_get_pos( sysarg_t *col, sysarg_t *row)70 static void screen_get_pos(ipcarg_t *col, ipcarg_t *row) 71 71 { 72 72 fflush(stdout); … … 74 74 } 75 75 76 static void screen_get_size( sysarg_t *col, sysarg_t *row)76 static void screen_get_size(ipcarg_t *col, ipcarg_t *row) 77 77 { 78 78 fflush(stdout); … … 94 94 static void screen_newline(void) 95 95 { 96 sysarg_t cols;97 sysarg_t rows;96 ipcarg_t cols; 97 ipcarg_t rows; 98 98 screen_get_size(&cols, &rows); 99 99 100 sysarg_t c;101 sysarg_t r;100 ipcarg_t c; 101 ipcarg_t r; 102 102 screen_get_pos(&c, &r); 103 103 104 sysarg_t i;104 ipcarg_t i; 105 105 for (i = c + 1; i < cols; i++) 106 106 puts(" "); … … 142 142 static void print_string(const char *str) 143 143 { 144 sysarg_t cols;145 sysarg_t rows;144 ipcarg_t cols; 145 ipcarg_t rows; 146 146 screen_get_size(&cols, &rows); 147 147 148 sysarg_t c;149 sysarg_t r;148 ipcarg_t c; 149 ipcarg_t r; 150 150 screen_get_pos(&c, &r); 151 151 152 if (c < cols) { 153 int pos = cols - c - 1; 154 printf("%.*s", pos, str); 155 } 152 if (c < cols) 153 printf("%.*s", cols - c - 1, str); 156 154 } 157 155 158 156 static inline void print_global_head(data_t *data) 159 157 { 160 printf("top - %02lu:%02lu:%02lu up " 161 "%" PRIun " days, %02" PRIun ":%02" PRIun ":%02" PRIun ", " 162 "load average:", 158 printf("top - %02lu:%02lu:%02lu up %u days, %02u:%02u:%02u, load average:", 163 159 data->hours, data->minutes, data->seconds, 164 160 data->udays, data->uhours, data->uminutes, data->useconds); … … 175 171 static inline void print_task_summary(data_t *data) 176 172 { 177 printf("tasks: % zu total", data->tasks_count);173 printf("tasks: %u total", data->tasks_count); 178 174 screen_newline(); 179 175 } … … 215 211 } 216 212 217 printf("threads: % zu total, %zu running, %zu ready, "218 "% zu sleeping, %zu lingering, %zu other, %zu invalid",213 printf("threads: %u total, %u running, %u ready, %u sleeping, %u lingering, " 214 "%u other, %u invalid", 219 215 total, running, ready, sleeping, lingering, other, invalid); 220 216 screen_newline(); … … 282 278 static inline void print_tasks(data_t *data) 283 279 { 284 sysarg_t cols;285 sysarg_t rows;280 ipcarg_t cols; 281 ipcarg_t rows; 286 282 screen_get_size(&cols, &rows); 287 283 288 sysarg_t col;289 sysarg_t row;284 ipcarg_t col; 285 ipcarg_t row; 290 286 screen_get_pos(&col, &row); 291 287 … … 299 295 order_suffix(task->virtmem, &virtmem, &virtmem_suffix); 300 296 301 printf("%-8" PRIu64 " %9 zu %8" PRIu64 "%c ", task->task_id,297 printf("%-8" PRIu64 " %9u %8" PRIu64 "%c ", task->task_id, 302 298 task->threads, virtmem, virtmem_suffix); 303 299 print_percent(perc->virtmem, 2); … … 329 325 static inline void print_ipc(data_t *data) 330 326 { 331 sysarg_t cols;332 sysarg_t rows;327 ipcarg_t cols; 328 ipcarg_t rows; 333 329 screen_get_size(&cols, &rows); 334 330 335 sysarg_t col;336 sysarg_t row;331 ipcarg_t col; 332 ipcarg_t row; 337 333 screen_get_pos(&col, &row); 338 334 … … 396 392 static inline void print_excs(data_t *data) 397 393 { 398 sysarg_t cols;399 sysarg_t rows;394 ipcarg_t cols; 395 ipcarg_t rows; 400 396 screen_get_size(&cols, &rows); 401 397 402 sysarg_t col;403 sysarg_t row;398 ipcarg_t col; 399 ipcarg_t row; 404 400 screen_get_pos(&col, &row); 405 401 … … 439 435 static void print_help(void) 440 436 { 441 sysarg_t cols;442 sysarg_t rows;437 ipcarg_t cols; 438 ipcarg_t rows; 443 439 screen_get_size(&cols, &rows); 444 440 445 sysarg_t col;446 sysarg_t row;441 ipcarg_t col; 442 ipcarg_t row; 447 443 screen_get_pos(&col, &row); 448 444
Note:
See TracChangeset
for help on using the changeset viewer.