Changes in uspace/srv/hid/fb/serial_console.c [32e7411:228e490] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/fb/serial_console.c
r32e7411 r228e490 47 47 #include <io/style.h> 48 48 #include <str.h> 49 #include <inttypes.h> 49 50 #include <io/screenbuffer.h> 50 51 … … 54 55 #define MAX_CONTROL 20 55 56 56 static ipcarg_t scr_width;57 static ipcarg_t scr_height;57 static sysarg_t scr_width; 58 static sysarg_t scr_height; 58 59 static bool color = true; /**< True if producing color output. */ 59 60 static bool utf8 = false; /**< True if producing UTF8 output. */ 60 61 static putc_function_t putc_function; 61 62 62 static ipcarg_t lastcol = 0;63 static ipcarg_t lastrow = 0;63 static sysarg_t lastcol = 0; 64 static sysarg_t lastrow = 0; 64 65 static attrs_t cur_attr = { 65 66 .t = at_style, … … 129 130 } 130 131 131 void serial_goto(const ipcarg_t col, const ipcarg_t row)132 void serial_goto(const sysarg_t col, const sysarg_t row) 132 133 { 133 134 if ((col > scr_width) || (row > scr_height)) … … 135 136 136 137 char control[MAX_CONTROL]; 137 snprintf(control, MAX_CONTROL, "\033[%u;%uf", row + 1, col + 1); 138 snprintf(control, MAX_CONTROL, "\033[%" PRIun ";%" PRIun "f", 139 row + 1, col + 1); 138 140 serial_puts(control); 139 141 } … … 250 252 251 253 /** Set scrolling region. */ 252 void serial_set_scroll_region( ipcarg_t last_row)254 void serial_set_scroll_region(sysarg_t last_row) 253 255 { 254 256 char control[MAX_CONTROL]; 255 snprintf(control, MAX_CONTROL, "\033[0;% ur", last_row);257 snprintf(control, MAX_CONTROL, "\033[0;%" PRIun "r", last_row); 256 258 serial_puts(control); 257 259 } … … 267 269 } 268 270 269 void serial_console_init(putc_function_t putc_fn, ipcarg_t w, ipcarg_t h)271 void serial_console_init(putc_function_t putc_fn, sysarg_t w, sysarg_t h) 270 272 { 271 273 scr_width = w; … … 284 286 * 285 287 */ 286 static void draw_text_data(keyfield_t *data, ipcarg_t x0, ipcarg_t y0,287 ipcarg_t width, ipcarg_t height)288 static void draw_text_data(keyfield_t *data, sysarg_t x0, sysarg_t y0, 289 sysarg_t width, sysarg_t height) 288 290 { 289 291 attrs_t *a0 = &data[0].attrs; 290 292 serial_set_attrs(a0); 291 293 292 ipcarg_t y;294 sysarg_t y; 293 295 for (y = 0; y < height; y++) { 294 296 serial_goto(x0, y0 + y); 295 297 296 ipcarg_t x;298 sysarg_t x; 297 299 for (x = 0; x < width; x++) { 298 300 attrs_t *attr = &data[y * width + x].attrs; … … 335 337 336 338 wchar_t c; 337 ipcarg_t col;338 ipcarg_t row;339 ipcarg_t w;340 ipcarg_t h;339 sysarg_t col; 340 sysarg_t row; 341 sysarg_t w; 342 sysarg_t h; 341 343 ssize_t rows; 342 344 343 345 int retval; 344 346 345 switch (IPC_GET_ METHOD(call)) {347 switch (IPC_GET_IMETHOD(call)) { 346 348 case IPC_M_PHONE_HUNGUP: 347 349 client_connected = 0; … … 440 442 441 443 if (rows >= 0) { 442 if (( ipcarg_t) rows > scr_height) {444 if ((sysarg_t) rows > scr_height) { 443 445 retval = EINVAL; 444 446 break; 445 447 } 446 448 } else { 447 if (( ipcarg_t) (-rows) > scr_height) {449 if ((sysarg_t) (-rows) > scr_height) { 448 450 retval = EINVAL; 449 451 break;
Note:
See TracChangeset
for help on using the changeset viewer.