Changeset 8565a42 in mainline for uspace/app/tetris/scores.c


Ignore:
Timestamp:
2018-03-02T20:34:50Z (7 years ago)
Author:
GitHub <noreply@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a1a81f69, d5e5fd1
Parents:
3061bc1 (diff), 34e1206 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:34:50)
git-committer:
GitHub <noreply@…> (2018-03-02 20:34:50)
Message:

Remove all trailing whitespace, everywhere.

See individual commit messages for details.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/tetris/scores.c

    r3061bc1 r8565a42  
    9898{
    9999        int i;
    100        
     100
    101101        clear_screen();
    102102        moveto(10, 0);
    103103        printf("\tRank \tLevel \tName\t                     points\n");
    104104        printf("\t========================================================\n");
    105        
     105
    106106        for (i = 0; i < NUMSPOTS - 1; i++)
    107107                printf("\t%6d %6d %-16s %20d\n",
    108108                    i + 1, scores[i].hs_level, scores[i].hs_name, scores[i].hs_score);
    109        
     109
    110110        if (!firstgame) {
    111111                printf("\t========================================================\n");
     
    113113                    scores[NUMSPOTS - 1].hs_level, scores[NUMSPOTS - 1].hs_name, scores[NUMSPOTS - 1].hs_score);
    114114        }
    115        
     115
    116116        printf("\n\n\n\n\tPress any key to return to main menu.");
    117117        getchar();
     
    125125        cons_event_t ev;
    126126        kbd_event_t *kev;
    127        
     127
    128128        clear_screen();
    129129        moveto(10, 10);
     
    133133        i = 6;
    134134        off = 6;
    135        
     135
    136136        moveto(10 , 28);
    137137        printf("%s%.*s", scores[NUMSPOTS - 1].hs_name, MAXLOGNAME-i,
    138138            "........................................");
    139        
     139
    140140        while (1) {
    141141                console_flush(console);
    142142                if (!console_get_event(console, &ev))
    143143                        exit(1);
    144                
     144
    145145                if (ev.type != CEV_KEY || ev.ev.key.type == KEY_RELEASE)
    146146                        continue;
    147                
     147
    148148                kev = &ev.ev.key;
    149                
     149
    150150                if (kev->key == KC_ENTER || kev->key == KC_NENTER)
    151151                        break;
    152                
     152
    153153                if (kev->key == KC_BACKSPACE) {
    154154                        if (i > 0) {
    155155                                wchar_t uc;
    156                                
     156
    157157                                --i;
    158158                                while (off > 0) {
     
    164164                                                break;
    165165                                }
    166                                
     166
    167167                                scores[NUMSPOTS - 1].hs_name[off] = '\0';
    168168                        }
     
    176176                        }
    177177                }
    178                
     178
    179179                moveto(10, 28);
    180180                printf("%s%.*s", scores[NUMSPOTS - 1].hs_name, MAXLOGNAME - i,
    181181                    "........................................");
    182182        }
    183        
     183
    184184        scores[NUMSPOTS - 1].hs_score = score;
    185185        scores[NUMSPOTS - 1].hs_level = level;
    186        
     186
    187187        i = NUMSPOTS - 1;
    188188        while ((i > 0) && (scores[i - 1].hs_score < score))
    189189                i--;
    190        
     190
    191191        for (j = NUMSPOTS - 2; j > i; j--)
    192192                copyhiscore(j, j-1);
    193        
     193
    194194        copyhiscore(i, NUMSPOTS - 1);
    195195}
     
    235235                return;
    236236        }
    237        
     237
    238238        cnt = fwrite(scores, sizeof(struct highscore), NUMSPOTS, f);
    239239        rc = fclose(f);
Note: See TracChangeset for help on using the changeset viewer.