Changeset a35b458 in mainline for uspace/app/tester/mm/malloc1.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/app/tester/mm/malloc1.c

    r3061bc1 ra35b458  
    208208{
    209209        for (unsigned int cycles = 0; /* always */; cycles++) {
    210                
     210
    211211                if ((subphase->cond.max_cycles) &&
    212212                    (cycles >= subphase->cond.max_cycles)) {
     
    217217                        break;
    218218                }
    219                
     219
    220220                /*
    221221                 * Decide whether we alloc or free memory in this step.
     
    229229                        int alloc = phase->alloc.min_block_size +
    230230                            (rand() % (phase->alloc.max_block_size - phase->alloc.min_block_size + 1));
    231                        
     231
    232232                        mem_block_t *blk = alloc_block(alloc);
    233233                        RETURN_IF_ERROR;
    234                        
     234
    235235                        if (blk == NULL) {
    236236                                TPRINTF("F(A)");
     
    244244                                RETURN_IF_ERROR;
    245245                        }
    246                        
     246
    247247                } else if (rnd < subphase->prob.free) {
    248248                        mem_block_t *blk = get_random_block();
     
    257257                                check_block(blk);
    258258                                RETURN_IF_ERROR;
    259                                
     259
    260260                                free_block(blk);
    261261                                RETURN_IF_ERROR;
     
    263263                }
    264264        }
    265        
     265
    266266        TPRINTF("\n..  finished.\n");
    267267}
     
    271271        for (unsigned int subno = 0; subno < 3; subno++) {
    272272                subphase_t *subphase = &phase->subphases[subno];
    273                
     273
    274274                TPRINTF(".. Sub-phase %u (%s)\n", subno + 1, subphase->name);
    275275                do_subphase(phase, subphase);
     
    281281{
    282282        init_mem();
    283        
     283
    284284        for (unsigned int phaseno = 0; phaseno < sizeof_array(phases);
    285285            phaseno++) {
    286286                phase_t *phase = &phases[phaseno];
    287                
     287
    288288                TPRINTF("Entering phase %u (%s)\n", phaseno + 1, phase->name);
    289                
     289
    290290                do_phase(phase);
    291291                if (error_flag)
    292292                        break;
    293                
     293
    294294                TPRINTF("Phase finished.\n");
    295295        }
    296        
     296
    297297        TPRINTF("Cleaning up.\n");
    298298        done_mem();
    299299        if (error_flag)
    300300                return "Test failed";
    301        
     301
    302302        return NULL;
    303303}
Note: See TracChangeset for help on using the changeset viewer.