Changeset a35b458 in mainline for uspace/srv/clipboard/clipboard.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
  • TabularUnified uspace/srv/clipboard/clipboard.c

    r3061bc1 ra35b458  
    5252        errno_t rc;
    5353        size_t size;
    54        
     54
    5555        switch (IPC_GET_ARG1(*request)) {
    5656        case CLIPBOARD_TAG_NONE:
    5757                fibril_mutex_lock(&clip_mtx);
    58                
     58
    5959                if (clip_data)
    6060                        free(clip_data);
    61                
     61
    6262                clip_data = NULL;
    6363                clip_size = 0;
    6464                clip_tag = CLIPBOARD_TAG_NONE;
    65                
     65
    6666                fibril_mutex_unlock(&clip_mtx);
    6767                async_answer_0(rid, EOK);
     
    7373                        break;
    7474                }
    75                
     75
    7676                fibril_mutex_lock(&clip_mtx);
    77                
     77
    7878                if (clip_data)
    7979                        free(clip_data);
    80                
     80
    8181                clip_data = data;
    8282                clip_size = size;
    8383                clip_tag = CLIPBOARD_TAG_DATA;
    84                
     84
    8585                fibril_mutex_unlock(&clip_mtx);
    8686                async_answer_0(rid, EOK);
     
    9494{
    9595        fibril_mutex_lock(&clip_mtx);
    96        
     96
    9797        ipc_callid_t callid;
    9898        size_t size;
    99        
     99
    100100        /* Check for clipboard data tag compatibility */
    101101        switch (IPC_GET_ARG1(*request)) {
     
    106106                        break;
    107107                }
    108                
     108
    109109                if (clip_tag != CLIPBOARD_TAG_DATA) {
    110110                        /* So far we only understand binary data */
     
    113113                        break;
    114114                }
    115                
     115
    116116                if (clip_size != size) {
    117117                        /* The client expects different size of data */
     
    120120                        break;
    121121                }
    122                
     122
    123123                errno_t retval = async_data_read_finalize(callid, clip_data, size);
    124124                if (retval != EOK) {
     
    126126                        break;
    127127                }
    128                
     128
    129129                async_answer_0(rid, EOK);
    130130                break;
     
    137137                break;
    138138        }
    139        
     139
    140140        fibril_mutex_unlock(&clip_mtx);
    141141}
     
    144144{
    145145        fibril_mutex_lock(&clip_mtx);
    146        
     146
    147147        size_t size = clip_size;
    148148        clipboard_tag_t tag = clip_tag;
    149        
     149
    150150        fibril_mutex_unlock(&clip_mtx);
    151151        async_answer_2(rid, EOK, (sysarg_t) size, (sysarg_t) tag);
     
    156156        /* Accept connection */
    157157        async_answer_0(iid, EOK);
    158        
     158
    159159        while (true) {
    160160                ipc_call_t call;
    161161                ipc_callid_t callid = async_get_call(&call);
    162                
     162
    163163                if (!IPC_GET_IMETHOD(call))
    164164                        break;
    165                
     165
    166166                switch (IPC_GET_IMETHOD(call)) {
    167167                case CLIPBOARD_PUT_DATA:
     
    183183{
    184184        errno_t rc;
    185        
     185
    186186        printf("%s: HelenOS clipboard service\n", NAME);
    187187        async_set_fallback_port_handler(clip_connection, NULL);
    188        
     188
    189189        rc = loc_server_register(NAME);
    190190        if (rc != EOK) {
     
    192192                return rc;
    193193        }
    194        
     194
    195195        rc = loc_service_register(SERVICE_NAME_CLIPBOARD, &svc_id);
    196196        if (rc != EOK) {
     
    198198                return rc;
    199199        }
    200        
     200
    201201        printf("%s: Accepting connections\n", NAME);
    202202        task_retval(0);
    203203        async_manager();
    204        
     204
    205205        /* Never reached */
    206206        return 0;
Note: See TracChangeset for help on using the changeset viewer.