Changeset a35b458 in mainline for uspace/lib/c/generic/io/console.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/lib/c/generic/io/console.c

    r3061bc1 ra35b458  
    4848        if (!ctrl)
    4949                return NULL;
    50        
     50
    5151        ctrl->input_sess = vfs_fsession(ifile, INTERFACE_CONSOLE);
    5252        if (!ctrl->input_sess) {
     
    5454                return NULL;
    5555        }
    56        
     56
    5757        ctrl->output_sess = vfs_fsession(ofile, INTERFACE_CONSOLE);
    5858        if (!ctrl->output_sess) {
     
    6060                return NULL;
    6161        }
    62        
     62
    6363        ctrl->input = ifile;
    6464        ctrl->output = ofile;
    6565        ctrl->input_aid = 0;
    66        
     66
    6767        return ctrl;
    6868}
     
    9595        errno_t rc = async_req_0_2(exch, CONSOLE_GET_SIZE, cols, rows);
    9696        async_exchange_end(exch);
    97        
     97
    9898        return rc;
    9999}
     
    134134        errno_t rc = async_req_0_1(exch, CONSOLE_GET_COLOR_CAP, ccap);
    135135        async_exchange_end(exch);
    136        
     136
    137137        return rc;
    138138}
     
    143143        errno_t rc = async_req_0_2(exch, CONSOLE_GET_POS, col, row);
    144144        async_exchange_end(exch);
    145        
     145
    146146        return rc;
    147147}
     
    183183        if (ctrl->input_aid == 0) {
    184184                ipc_call_t result;
    185                
     185
    186186                async_exch_t *exch = async_exchange_begin(ctrl->input_sess);
    187187                aid_t aid = async_send_0(exch, CONSOLE_GET_EVENT, &result);
    188188                async_exchange_end(exch);
    189                
     189
    190190                errno_t rc;
    191191                async_wait_for(aid, &rc);
    192                
     192
    193193                if (rc != EOK) {
    194194                        errno = rc;
    195195                        return false;
    196196                }
    197                
     197
    198198                rc = console_ev_decode(&result, event);
    199199                if (rc != EOK) {
     
    204204                errno_t retval;
    205205                async_wait_for(ctrl->input_aid, &retval);
    206                
     206
    207207                ctrl->input_aid = 0;
    208                
     208
    209209                if (retval != EOK) {
    210210                        errno = retval;
    211211                        return false;
    212212                }
    213                
     213
    214214                errno_t rc = console_ev_decode(&ctrl->input_call, event);
    215215                if (rc != EOK) {
     
    218218                }
    219219        }
    220        
     220
    221221        return true;
    222222}
     
    227227        struct timeval t0;
    228228        gettimeofday(&t0, NULL);
    229        
     229
    230230        if (ctrl->input_aid == 0) {
    231231                async_exch_t *exch = async_exchange_begin(ctrl->input_sess);
     
    234234                async_exchange_end(exch);
    235235        }
    236        
     236
    237237        errno_t retval;
    238238        errno_t rc = async_wait_timeout(ctrl->input_aid, &retval, *timeout);
     
    242242                return false;
    243243        }
    244        
     244
    245245        ctrl->input_aid = 0;
    246        
     246
    247247        if (retval != EOK) {
    248248                errno = retval;
    249249                return false;
    250250        }
    251        
     251
    252252        rc = console_ev_decode(&ctrl->input_call, event);
    253253        if (rc != EOK) {
     
    255255                return false;
    256256        }
    257        
     257
    258258        /* Update timeout */
    259259        struct timeval t1;
    260260        gettimeofday(&t1, NULL);
    261261        *timeout -= tv_sub_diff(&t1, &t0);
    262        
     262
    263263        return true;
    264264}
Note: See TracChangeset for help on using the changeset viewer.