Changeset a35b458 in mainline for kernel/genarch/src/kbrd


Ignore:
Timestamp:
2018-03-02T20:10:49Z (8 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.

Location:
kernel/genarch/src/kbrd
Files:
3 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}
  • 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}
  • kernel/genarch/src/kbrd/scanc_pc.c

    r3061bc1 ra35b458  
    158158        U_SPECIAL,      /* 0x45 - NumLock */
    159159        U_SPECIAL,      /* 0x46 - ScrollLock */
    160        
     160
    161161        U_HOME_ARROW,   /* 0x47 - Home */
    162162        U_UP_ARROW,     /* 0x48 - Up Arrow */
Note: See TracChangeset for help on using the changeset viewer.