Changeset a35b458 in mainline for uspace/srv/hid/output/proto/vt100.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/hid/output/proto/vt100.c

    r3061bc1 ra35b458  
    7777{
    7878        char control[MAX_CONTROL];
    79        
     79
    8080        snprintf(control, MAX_CONTROL, "\033[%um", mode);
    8181        state->control_puts(control);
     
    8585{
    8686        char control[MAX_CONTROL];
    87        
     87
    8888        snprintf(control, MAX_CONTROL, "\033[%" PRIun ";%" PRIun "f",
    8989            row + 1, col + 1);
     
    123123                vt100_sgr(state, SGR_BGCOLOR + color_map[attrs.val.index.bgcolor & 7]);
    124124                vt100_sgr(state, SGR_FGCOLOR + color_map[attrs.val.index.fgcolor & 7]);
    125                
     125
    126126                if (attrs.val.index.attr & CATTR_BRIGHT)
    127127                        vt100_sgr(state, SGR_BOLD);
    128                
     128
    129129                break;
    130130        case CHAR_ATTR_RGB:
    131131                vt100_sgr(state, SGR_RESET);
    132                
     132
    133133                if (attrs.val.rgb.bgcolor <= attrs.val.rgb.fgcolor)
    134134                        vt100_sgr(state, SGR_REVERSE);
    135                
     135
    136136                break;
    137137        }
     
    145145        if (state == NULL)
    146146                return NULL;
    147        
     147
    148148        state->putchar = putchar_fn;
    149149        state->control_puts = control_puts_fn;
    150150        state->flush = flush_fn;
    151        
     151
    152152        state->cols = cols;
    153153        state->rows = rows;
    154        
     154
    155155        state->cur_col = (sysarg_t) -1;
    156156        state->cur_row = (sysarg_t) -1;
    157        
     157
    158158        state->cur_attrs.type = CHAR_ATTR_STYLE;
    159159        state->cur_attrs.val.style = STYLE_NORMAL;
    160        
     160
    161161        /* Initialize graphic rendition attributes */
    162162        vt100_sgr(state, SGR_RESET);
     
    195195        if ((col >= state->cols) || (row >= state->rows))
    196196                return;
    197        
     197
    198198        if ((col != state->cur_col) || (row != state->cur_row)) {
    199199                vt100_set_pos(state, col, row);
     
    223223        state->putchar(ch == 0 ? ' ' : ch);
    224224        state->cur_col++;
    225        
     225
    226226        if (state->cur_col >= state->cols) {
    227227                state->cur_row += state->cur_col / state->cols;
Note: See TracChangeset for help on using the changeset viewer.