Ignore:
Timestamp:
2018-03-02T20:10:49Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f1380b7
Parents:
3061bc1
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
Message:

style: Remove trailing whitespace on _all_ lines, including empty ones, for particular file types.

Command used: tools/srepl '\s\+$' '' -- *.c *.h *.py *.sh *.s *.S *.ag

Currently, whitespace on empty lines is very inconsistent.
There are two basic choices: Either remove the whitespace, or keep empty lines
indented to the level of surrounding code. The former is AFAICT more common,
and also much easier to do automatically.

Alternatively, we could write script for automatic indentation, and use that
instead. However, if such a script exists, it's possible to use the indented
style locally, by having the editor apply relevant conversions on load/save,
without affecting remote repository. IMO, it makes more sense to adopt
the simpler rule.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/dist/src/c/demos/tetris/scores.c

    r3061bc1 ra35b458  
    9999{
    100100        int i;
    101        
     101
    102102        clear_screen();
    103103        moveto(10, 0);
    104104        printf("\tRank \tLevel \tName\t                     points\n");
    105105        printf("\t========================================================\n");
    106        
     106
    107107        for (i = 0; i < NUMSPOTS - 1; i++)
    108108                printf("\t%6d %6d %-16s %20d\n",
    109109                    i + 1, scores[i].hs_level, scores[i].hs_name, scores[i].hs_score);
    110        
     110
    111111        if (!firstgame) {
    112112                printf("\t========================================================\n");
     
    114114                    scores[NUMSPOTS - 1].hs_level, scores[NUMSPOTS - 1].hs_name, scores[NUMSPOTS - 1].hs_score);
    115115        }
    116        
     116
    117117        printf("\n\n\n\n\tPress any key to return to main menu.");
    118118        getchar();
     
    126126        cons_event_t ev;
    127127        kbd_event_t *kev;
    128        
     128
    129129        clear_screen();
    130130        moveto(10, 10);
     
    134134        i = 6;
    135135        off = 6;
    136        
     136
    137137        moveto(10 , 28);
    138138        printf("%s%.*s", scores[NUMSPOTS - 1].hs_name, MAXLOGNAME-i,
    139139            "........................................");
    140        
     140
    141141        while (1) {
    142142                console_flush(console);
    143143                if (!console_get_event(console, &ev))
    144144                        exit(1);
    145                
     145
    146146                if (ev.type != CEV_KEY || ev.ev.key.type == KEY_RELEASE)
    147147                        continue;
    148                
     148
    149149                kev = &ev.ev.key;
    150                
     150
    151151                if (kev->key == KC_ENTER || kev->key == KC_NENTER)
    152152                        break;
    153                
     153
    154154                if (kev->key == KC_BACKSPACE) {
    155155                        if (i > 0) {
    156156                                wchar_t uc;
    157                                
     157
    158158                                --i;
    159159                                while (off > 0) {
     
    165165                                                break;
    166166                                }
    167                                
     167
    168168                                scores[NUMSPOTS - 1].hs_name[off] = '\0';
    169169                        }
     
    177177                        }
    178178                }
    179                
     179
    180180                moveto(10, 28);
    181181                printf("%s%.*s", scores[NUMSPOTS - 1].hs_name, MAXLOGNAME - i,
    182182                    "........................................");
    183183        }
    184        
     184
    185185        scores[NUMSPOTS - 1].hs_score = score;
    186186        scores[NUMSPOTS - 1].hs_level = level;
    187        
     187
    188188        i = NUMSPOTS - 1;
    189189        while ((i > 0) && (scores[i - 1].hs_score < score))
    190190                i--;
    191        
     191
    192192        for (j = NUMSPOTS - 2; j > i; j--)
    193193                copyhiscore(j, j-1);
    194        
     194
    195195        copyhiscore(i, NUMSPOTS - 1);
    196196}
     
    236236                return;
    237237        }
    238        
     238
    239239        cnt = fwrite(scores, sizeof(struct highscore), NUMSPOTS, f);
    240240        rc = fclose(f);
Note: See TracChangeset for help on using the changeset viewer.