Changeset a35b458 in mainline for kernel/genarch/src/kbrd/kbrd_at.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
  • kernel/genarch/src/kbrd/kbrd_at.c

    r3061bc1 ra35b458  
    7171{
    7272        spinlock_lock(&instance->keylock);
    73        
     73
    7474        switch (sc) {
    7575        case SC_LSHIFT:
     
    8787                break;
    8888        }
    89        
     89
    9090        spinlock_unlock(&instance->keylock);
    9191}
     
    100100        bool shift;
    101101        bool capslock;
    102        
     102
    103103        spinlock_lock(&instance->keylock);
    104        
     104
    105105        switch (sc) {
    106106        case SC_LSHIFT:
     
    118118                capslock = (instance->keyflags & PRESSED_CAPSLOCK) ||
    119119                    (instance->lockflags & LOCKED_CAPSLOCK);
    120                
     120
    121121                if ((letter) && (capslock))
    122122                        shift = !shift;
    123                
     123
    124124                if (shift)
    125125                        indev_push_character(instance->sink, sc_secondary_map[sc]);
     
    128128                break;
    129129        }
    130        
     130
    131131        spinlock_unlock(&instance->keylock);
    132132}
     
    137137        static int is_locked = 0;
    138138        kbrd_instance_t *instance = (kbrd_instance_t *) arg;
    139        
     139
    140140        while (true) {
    141141                wchar_t sc = indev_pop_character(&instance->raw);
     
    162162                        }
    163163                }
    164                
     164
    165165        }
    166166}
     
    174174                instance->thread = thread_create(kkbrd, (void *) instance, TASK, 0,
    175175                    "kkbrd");
    176                
     176
    177177                if (!instance->thread) {
    178178                        free(instance);
    179179                        return NULL;
    180180                }
    181                
     181
    182182                instance->sink = NULL;
    183183                indev_initialize("kbrd", &instance->raw, &kbrd_raw_ops);
    184                
     184
    185185                spinlock_initialize(&instance->keylock, "kbrd_at.instance.keylock");
    186186                instance->keyflags = 0;
    187187                instance->lockflags = 0;
    188188        }
    189        
     189
    190190        return instance;
    191191}
     
    195195        assert(instance);
    196196        assert(sink);
    197        
     197
    198198        instance->sink = sink;
    199199        thread_ready(instance->thread);
    200        
     200
    201201        return &instance->raw;
    202202}
Note: See TracChangeset for help on using the changeset viewer.