Changeset a35b458 in mainline for uspace/srv/fs/fat/fat_dentry.c


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/srv/fs/fat/fat_dentry.c

    r3061bc1 ra35b458  
    8181{
    8282        unsigned int i;
    83        
     83
    8484        for (i = 0; i < FAT_NAME_LEN; i++) {
    8585                if (d->name[i] == FAT_PAD)
    8686                        break;
    87                
     87
    8888                if (d->name[i] == FAT_DENTRY_E5_ESC)
    8989                        *buf++ = 0xe5;
     
    9595                }
    9696        }
    97        
     97
    9898        if (d->ext[0] != FAT_PAD)
    9999                *buf++ = '.';
    100        
     100
    101101        for (i = 0; i < FAT_EXT_LEN; i++) {
    102102                if (d->ext[i] == FAT_PAD) {
     
    104104                        return;
    105105                }
    106                
     106
    107107                if (d->ext[i] == FAT_DENTRY_E5_ESC)
    108108                        *buf++ = 0xe5;
     
    114114                }
    115115        }
    116        
     116
    117117        *buf = '\0';
    118118}
     
    124124        bool lower_name = true;
    125125        bool lower_ext = true;
    126        
     126
    127127        for (i = 0; i < FAT_NAME_LEN; i++) {
    128128                switch ((uint8_t) *name) {
     
    140140                                        lower_name = false;
    141141                        }
    142                        
     142
    143143                        d->name[i] = toupper(*name++);
    144144                        break;
    145145                }
    146146        }
    147        
     147
    148148        if (*name++ != '.')
    149149                name = fake_ext;
    150        
     150
    151151        for (i = 0; i < FAT_EXT_LEN; i++) {
    152152                switch ((uint8_t) *name) {
     
    163163                                        lower_ext = false;
    164164                        }
    165                        
     165
    166166                        d->ext[i] = toupper(*name++);
    167167                        break;
    168168                }
    169169        }
    170        
     170
    171171        if (lower_name)
    172172                d->lcase |= FAT_LCASE_LOWER_NAME;
    173173        else
    174174                d->lcase &= ~FAT_LCASE_LOWER_NAME;
    175        
     175
    176176        if (lower_ext)
    177177                d->lcase |= FAT_LCASE_LOWER_EXT;
     
    183183{
    184184        unsigned int i;
    185        
     185
    186186        for (i = 0; i < FAT_NAME_LEN; i++) {
    187187                if (d->name[i] == FAT_PAD)
    188188                        break;
    189                
     189
    190190                if (d->name[i] == FAT_DENTRY_E5_ESC)
    191191                        *buf++ = 0xe5;
     
    193193                        *buf++ = d->name[i];
    194194        }
    195        
     195
    196196        for (i = 0; i < FAT_EXT_LEN; i++) {
    197197                if (d->ext[i] == FAT_PAD) {
     
    199199                        return;
    200200                }
    201                
     201
    202202                if (d->ext[i] == FAT_DENTRY_E5_ESC)
    203203                        *buf++ = 0xe5;
     
    205205                        *buf++ = d->ext[i];
    206206        }
    207        
     207
    208208        *buf = '\0';
    209209}
     
    291291{
    292292        size_t size = 0;
    293        
     293
    294294        size += fat_lfn_str_nlength(FAT_LFN_PART1(d), FAT_LFN_PART1_SIZE);
    295295        size += fat_lfn_str_nlength(FAT_LFN_PART2(d), FAT_LFN_PART2_SIZE);
    296296        size += fat_lfn_str_nlength(FAT_LFN_PART3(d), FAT_LFN_PART3_SIZE);
    297        
     297
    298298        return size;
    299299}
     
    354354        d->lfn.type = 0;
    355355        d->lfn.firstc_lo = 0;
    356        
     356
    357357        return *offset;
    358358}
     
    363363        size_t off = 0;
    364364        size_t i = 0;
    365        
     365
    366366        while (i < count) {
    367367                if ((ch = str_decode(src, &off, STR_NO_LIMIT)) != 0) {
     
    384384        size_t offset=0;
    385385        bool result = true;
    386        
     386
    387387        while ((ch = str_decode(name, &offset, STR_NO_LIMIT)) != 0) {
    388388                if (str_chr(FAT_STOP_CHARS, ch) != NULL) {
Note: See TracChangeset for help on using the changeset viewer.