Changeset 87822ce in mainline for uspace/app/tetris
- Timestamp:
- 2021-03-04T19:14:30Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d6c4d40
- Parents:
- 760a392
- Location:
- uspace/app/tetris
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tetris/scores.c
r760a392 r87822ce 126 126 cons_event_t ev; 127 127 kbd_event_t *kev; 128 errno_t rc; 128 129 129 130 clear_screen(); … … 141 142 while (true) { 142 143 console_flush(console); 143 if (!console_get_event(console, &ev)) 144 rc = console_get_event(console, &ev); 145 if (rc != EOK) 144 146 exit(1); 145 147 -
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) -
uspace/app/tetris/tetris.c
r760a392 r87822ce 202 202 while (true) { 203 203 int i = getchar(); 204 if (i < 0) 205 return 0; 204 206 205 207 switch (i) {
Note:
See TracChangeset
for help on using the changeset viewer.
