Changeset 87822ce in mainline for uspace/app/tetris/screen.c
- Timestamp:
- 2021-03-04T19:14:30Z (4 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d6c4d40
- Parents:
- 760a392
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tetris/screen.c
r760a392 r87822ce 54 54 */ 55 55 56 #include <errno.h> 56 57 #include <stdio.h> 57 58 #include <stdlib.h> … … 340 341 { 341 342 usec_t timeout = fallrate; 343 errno_t rc; 342 344 343 345 while (timeout > 0) { 344 346 cons_event_t event; 345 347 346 if (!console_get_event_timeout(console, &event, &timeout)) 348 rc = console_get_event_timeout(console, &event, &timeout); 349 if (rc == ETIMEOUT) 347 350 break; 351 if (rc != EOK) 352 exit(1); 348 353 } 349 354 } … … 354 359 int tgetchar(void) 355 360 { 361 errno_t rc; 362 356 363 /* 357 364 * Reset timeleft to fallrate whenever it is not positive … … 376 383 cons_event_t event; 377 384 378 if (!console_get_event_timeout(console, &event, &timeleft)) { 385 rc = console_get_event_timeout(console, &event, &timeleft); 386 if (rc == ETIMEOUT) { 379 387 timeleft = 0; 380 388 return -1; 381 389 } 390 if (rc != EOK) 391 exit(1); 382 392 383 393 if (event.type == CEV_KEY && event.ev.key.type == KEY_PRESS) … … 394 404 { 395 405 char32_t c = 0; 406 errno_t rc; 396 407 397 408 while (c == 0) { 398 409 cons_event_t event; 399 410 400 if (!console_get_event(console, &event)) 411 rc = console_get_event(console, &event); 412 if (rc == ETIMEOUT) 401 413 return -1; 414 if (rc != EOK) 415 exit(1); 402 416 403 417 if (event.type == CEV_KEY && event.ev.key.type == KEY_PRESS)
Note:
See TracChangeset
for help on using the changeset viewer.