Changeset a35b458 in mainline for uspace/srv/ns/service.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/ns/service.c

    r3061bc1 ra35b458  
    4343typedef struct {
    4444        ht_link_t link;
    45        
     45
    4646        /** Service ID */
    4747        service_t service;
    48        
     48
    4949        /** Session to the service */
    5050        async_sess_t *sess;
     
    6060        hashed_service_t *service =
    6161            hash_table_get_inst(item, hashed_service_t, link);
    62        
     62
    6363        return service->service;
    6464}
     
    6868        hashed_service_t *service =
    6969            hash_table_get_inst(item, hashed_service_t, link);
    70        
     70
    7171        return service->service == *(service_t *) key;
    7272}
     
    102102                return ENOMEM;
    103103        }
    104        
     104
    105105        list_initialize(&pending_conn);
    106        
     106
    107107        return EOK;
    108108}
     
    116116                if (!link)
    117117                        continue;
    118                
     118
    119119                hashed_service_t *hashed_service = hash_table_get_inst(link, hashed_service_t, link);
    120120                async_exch_t *exch = async_exchange_begin(hashed_service->sess);
     
    122122                    pending->arg3, 0, IPC_FF_NONE);
    123123                async_exchange_end(exch);
    124                
     124
    125125                list_remove(&pending->link);
    126126                free(pending);
    127                
     127
    128128                goto loop;
    129129        }
     
    143143        if (hash_table_find(&service_hash_table, &service))
    144144                return EEXIST;
    145        
     145
    146146        hashed_service_t *hashed_service =
    147147            (hashed_service_t *) malloc(sizeof(hashed_service_t));
    148148        if (!hashed_service)
    149149                return ENOMEM;
    150        
     150
    151151        hashed_service->service = service;
    152152        hashed_service->sess = async_callback_receive(EXCHANGE_SERIALIZE);
    153153        if (hashed_service->sess == NULL)
    154154                return EIO;
    155        
     155
    156156        hash_table_insert(&service_hash_table, &hashed_service->link);
    157157        return EOK;
     
    174174        sysarg_t flags = IPC_GET_ARG4(*call);
    175175        errno_t retval;
    176        
     176
    177177        ht_link_t *link = hash_table_find(&service_hash_table, &service);
    178178        if (!link) {
     
    185185                                goto out;
    186186                        }
    187                        
     187
    188188                        link_initialize(&pending->link);
    189189                        pending->service = service;
     
    191191                        pending->callid = callid;
    192192                        pending->arg3 = arg3;
    193                        
     193
    194194                        list_append(&pending->link, &pending_conn);
    195195                        return;
    196196                }
    197                
     197
    198198                retval = ENOENT;
    199199                goto out;
    200200        }
    201        
     201
    202202        hashed_service_t *hashed_service = hash_table_get_inst(link, hashed_service_t, link);
    203203        async_exch_t *exch = async_exchange_begin(hashed_service->sess);
     
    205205        async_exchange_end(exch);
    206206        return;
    207        
     207
    208208out:
    209209        async_answer_0(callid, retval);
Note: See TracChangeset for help on using the changeset viewer.