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

    r3061bc1 ra35b458  
    7878{
    7979        spinlock_lock(&instance->keylock);
    80        
     80
    8181        switch (sc) {
    8282        case SC_LSHIFT:
     
    9494                break;
    9595        }
    96        
     96
    9797        spinlock_unlock(&instance->keylock);
    9898}
     
    108108        bool capslock;
    109109        wchar_t ch;
    110        
     110
    111111        spinlock_lock(&instance->keylock);
    112        
     112
    113113        switch (sc) {
    114114        case SC_LSHIFT:
     
    126126                capslock = (instance->keyflags & PRESSED_CAPSLOCK) ||
    127127                    (instance->lockflags & LOCKED_CAPSLOCK);
    128                
     128
    129129                if ((letter) && (capslock))
    130130                        shift = !shift;
    131                
     131
    132132                if (shift)
    133133                        ch = sc_secondary_map[sc];
    134134                else
    135135                        ch = sc_primary_map[sc];
    136                
     136
    137137                switch (ch) {
    138138                case U_PAGE_UP:
     
    145145                        indev_push_character(instance->sink, ch);
    146146                }
    147                
    148                 break;
    149         }
    150        
     147
     148                break;
     149        }
     150
    151151        spinlock_unlock(&instance->keylock);
    152152}
     
    155155{
    156156        kbrd_instance_t *instance = (kbrd_instance_t *) arg;
    157        
     157
    158158        while (true) {
    159159                wchar_t sc = indev_pop_character(&instance->raw);
    160                
     160
    161161                if (sc == IGNORE_CODE)
    162162                        continue;
    163                
     163
    164164                if (sc & KEY_RELEASE)
    165165                        key_released(instance, (sc ^ KEY_RELEASE) & 0x7f);
     
    176176                instance->thread = thread_create(kkbrd, (void *) instance,
    177177                    TASK, THREAD_FLAG_NONE, "kkbrd");
    178                
     178
    179179                if (!instance->thread) {
    180180                        free(instance);
    181181                        return NULL;
    182182                }
    183                
     183
    184184                instance->sink = NULL;
    185185                indev_initialize("kbrd", &instance->raw, &kbrd_raw_ops);
    186                
     186
    187187                spinlock_initialize(&instance->keylock, "kbrd.instance.keylock");
    188188                instance->keyflags = 0;
    189189                instance->lockflags = 0;
    190190        }
    191        
     191
    192192        return instance;
    193193}
     
    197197        assert(instance);
    198198        assert(sink);
    199        
     199
    200200        instance->sink = sink;
    201201        thread_ready(instance->thread);
    202        
     202
    203203        return &instance->raw;
    204204}
Note: See TracChangeset for help on using the changeset viewer.