Changeset 57dea62 in mainline


Ignore:
Timestamp:
2015-08-22T03:58:28Z (9 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
566992e1
Parents:
9cfbf2f
Message:

coding style (no change in functionality)

File:
1 edited

Legend:

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

    r9cfbf2f r57dea62  
    189189        /** If reply was received. */
    190190        bool done;
    191 
     191       
    192192        /** If the message / reply should be discarded on arrival. */
    193193        bool forget;
    194 
     194       
    195195        /** If already destroyed. */
    196196        bool destroyed;
     
    266266{
    267267        struct timeval tv = { 0, 0 };
    268 
     268       
    269269        to->inlist = false;
    270270        to->occurred = false;
     
    289289static amsg_t *amsg_create(void)
    290290{
    291         amsg_t *msg;
    292 
    293         msg = malloc(sizeof(amsg_t));
     291        amsg_t *msg = malloc(sizeof(amsg_t));
    294292        if (msg) {
    295293                msg->done = false;
     
    300298                awaiter_initialize(&msg->wdata);
    301299        }
    302 
     300       
    303301        return msg;
    304302}
     
    869867        }
    870868       
    871         msg_t *msg = list_get_instance(list_first(&conn->msg_queue), msg_t, link);
     869        msg_t *msg = list_get_instance(list_first(&conn->msg_queue),
     870            msg_t, link);
    872871        list_remove(&msg->link);
    873872       
     
    937936        if (!client)
    938937                return NULL;
     938       
    939939        if (!client->data) {
    940940                async_client_put(client);
    941941                return NULL;
    942942        }
    943 
     943       
    944944        return client->data;
    945945}
     
    948948{
    949949        client_t *client = async_client_get(client_id, false);
    950 
     950       
    951951        assert(client);
    952952        assert(client->data);
    953 
     953       
    954954        /* Drop the reference we got in async_get_client_data_by_hash(). */
    955955        async_client_put(client);
    956 
     956       
    957957        /* Drop our own reference we got at the beginning of this function. */
    958958        async_client_put(client);
     
    13461346       
    13471347        msg->done = true;
    1348 
     1348       
    13491349        if (msg->forget) {
    13501350                assert(msg->wdata.active);
     
    13541354                fibril_add_ready(msg->wdata.fid);
    13551355        }
    1356 
     1356       
    13571357        futex_up(&async_futex);
    13581358}
     
    14461446       
    14471447        futex_down(&async_futex);
    1448 
     1448       
    14491449        assert(!msg->forget);
    14501450        assert(!msg->destroyed);
    1451 
     1451       
    14521452        if (msg->done) {
    14531453                futex_up(&async_futex);
     
    14901490       
    14911491        amsg_t *msg = (amsg_t *) amsgid;
    1492 
     1492       
    14931493        futex_down(&async_futex);
    1494 
     1494       
    14951495        assert(!msg->forget);
    14961496        assert(!msg->destroyed);
    1497 
     1497       
    14981498        if (msg->done) {
    14991499                futex_up(&async_futex);
     
    15071507        if (timeout < 0)
    15081508                timeout = 0;
    1509 
     1509       
    15101510        getuptime(&msg->wdata.to_event.expires);
    15111511        tv_add_diff(&msg->wdata.to_event.expires, timeout);
     
    15601560{
    15611561        amsg_t *msg = (amsg_t *) amsgid;
    1562 
     1562       
    15631563        assert(msg);
    15641564        assert(!msg->forget);
    15651565        assert(!msg->destroyed);
    1566 
     1566       
    15671567        futex_down(&async_futex);
     1568       
    15681569        if (msg->done) {
    15691570                amsg_destroy(msg);
     
    15721573                msg->forget = true;
    15731574        }
     1575       
    15741576        futex_up(&async_futex);
    15751577}
     
    26972699        }
    26982700       
    2699         void *_data;
     2701        void *arg_data;
    27002702       
    27012703        if (nullterm)
    2702                 _data = malloc(size + 1);
     2704                arg_data = malloc(size + 1);
    27032705        else
    2704                 _data = malloc(size);
    2705        
    2706         if (_data == NULL) {
     2706                arg_data = malloc(size);
     2707       
     2708        if (arg_data == NULL) {
    27072709                ipc_answer_0(callid, ENOMEM);
    27082710                return ENOMEM;
    27092711        }
    27102712       
    2711         int rc = async_data_write_finalize(callid, _data, size);
     2713        int rc = async_data_write_finalize(callid, arg_data, size);
    27122714        if (rc != EOK) {
    2713                 free(_data);
     2715                free(arg_data);
    27142716                return rc;
    27152717        }
    27162718       
    27172719        if (nullterm)
    2718                 ((char *) _data)[size] = 0;
    2719        
    2720         *data = _data;
     2720                ((char *) arg_data)[size] = 0;
     2721       
     2722        *data = arg_data;
    27212723        if (received != NULL)
    27222724                *received = size;
     
    29372939{
    29382940        assert(callid);
    2939 
     2941       
    29402942        ipc_call_t call;
    29412943        *callid = async_get_call(&call);
    2942 
     2944       
    29432945        if (IPC_GET_IMETHOD(call) != IPC_M_STATE_CHANGE_AUTHORIZE)
    29442946                return false;
     
    29502952        if (arg3)
    29512953                *arg3 = IPC_GET_ARG3(call);
    2952 
     2954       
    29532955        return true;
    29542956}
Note: See TracChangeset for help on using the changeset viewer.