Changeset 8565a42 in mainline for uspace/lib/c/generic/clipboard.c


Ignore:
Timestamp:
2018-03-02T20:34:50Z (7 years ago)
Author:
GitHub <noreply@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a1a81f69, d5e5fd1
Parents:
3061bc1 (diff), 34e1206 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:34:50)
git-committer:
GitHub <noreply@…> (2018-03-02 20:34:50)
Message:

Remove all trailing whitespace, everywhere.

See individual commit messages for details.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/clipboard.c

    r3061bc1 r8565a42  
    6060        service_id_t sid;
    6161        errno_t rc;
    62        
     62
    6363        fibril_mutex_lock(&clip_mutex);
    64        
     64
    6565        while (clip_sess == NULL) {
    6666                rc = loc_service_get_id(SERVICE_NAME_CLIPBOARD, &sid,
     
    6868                if (rc != EOK)
    6969                        continue;
    70                
     70
    7171                clip_sess = loc_service_connect(sid, INTERFACE_CLIPBOARD,
    7272                    IPC_FLAG_BLOCKING);
    7373        }
    74        
     74
    7575        fibril_mutex_unlock(&clip_mutex);
    76        
     76
    7777        return async_exchange_begin(clip_sess);
    7878}
     
    101101{
    102102        size_t size = str_size(str);
    103        
     103
    104104        if (size == 0) {
    105105                async_exch_t *exch = clip_exchange_begin();
     
    107107                    CLIPBOARD_TAG_NONE);
    108108                clip_exchange_end(exch);
    109                
     109
    110110                return (errno_t) rc;
    111111        } else {
     
    115115                errno_t rc = async_data_write_start(exch, (void *) str, size);
    116116                clip_exchange_end(exch);
    117                
     117
    118118                if (rc != EOK) {
    119119                        errno_t rc_orig;
     
    124124                                return (errno_t) rc_orig;
    125125                }
    126                
     126
    127127                async_wait_for(req, &rc);
    128                
     128
    129129                return (errno_t) rc;
    130130        }
     
    145145        while (true) {
    146146                async_exch_t *exch = clip_exchange_begin();
    147                
     147
    148148                sysarg_t size;
    149149                sysarg_t tag;
    150150                errno_t rc = async_req_0_2(exch, CLIPBOARD_CONTENT, &size, &tag);
    151                
     151
    152152                clip_exchange_end(exch);
    153                
     153
    154154                if (rc != EOK)
    155155                        return (errno_t) rc;
    156                
     156
    157157                char *sbuf;
    158                
     158
    159159                switch (tag) {
    160160                case CLIPBOARD_TAG_NONE:
     
    162162                        if (sbuf == NULL)
    163163                                return ENOMEM;
    164                        
     164
    165165                        sbuf[0] = 0;
    166166                        *str = sbuf;
     
    170170                        if (sbuf == NULL)
    171171                                return ENOMEM;
    172                        
     172
    173173                        exch = clip_exchange_begin();
    174174                        aid_t req = async_send_1(exch, CLIPBOARD_GET_DATA, tag, NULL);
    175175                        rc = async_data_read_start(exch, (void *) sbuf, size);
    176176                        clip_exchange_end(exch);
    177                        
     177
    178178                        if ((errno_t) rc == EOVERFLOW) {
    179179                                /*
     
    183183                                break;
    184184                        }
    185                        
     185
    186186                        if (rc != EOK) {
    187187                                errno_t rc_orig;
     
    192192                                        return (errno_t) rc_orig;
    193193                        }
    194                        
     194
    195195                        async_wait_for(req, &rc);
    196                        
     196
    197197                        if (rc == EOK) {
    198198                                sbuf[size] = 0;
    199199                                *str = sbuf;
    200200                        }
    201                        
     201
    202202                        return rc;
    203203                default:
Note: See TracChangeset for help on using the changeset viewer.