Changeset b7fd2a0 in mainline for uspace/lib/c/generic/ns.c


Ignore:
Timestamp:
2018-01-13T03:10:29Z (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:
a53ed3a
Parents:
36f0738
Message:

Use errno_t in all uspace and kernel code.

Change type of every variable, parameter and return value that holds an
<errno.h> constant to either errno_t (the usual case), or sys_errno_t
(some places in kernel). This is for the purpose of self-documentation,
as well as for type-checking with a bit of type definition hackery.

Although this is a massive commit, it is a simple text replacement, and thus
is very easy to verify. Simply do the following:

`
git checkout <this commit's hash>
git reset HEAD
git add .
tools/srepl '\berrno_t\b' int
git add .
tools/srepl '\bsys_errno_t\b' sysarg_t
git reset
git diff
`

While this doesn't ensure that the replacements are correct, it does ensure
that the commit doesn't do anything except those replacements. Since errno_t
is typedef'd to int in the usual case (and sys_errno_t to sysarg_t), even if
incorrect, this commit cannot change behavior.

File:
1 edited

Legend:

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

    r36f0738 rb7fd2a0  
    4646static async_sess_t *sess_ns = NULL;
    4747
    48 int service_register(service_t service)
     48errno_t service_register(service_t service)
    4949{
    50         int retval;
     50        errno_t retval;
    5151        ipc_call_t answer;
    5252       
     
    5757        async_exch_t *exch = async_exchange_begin(sess);
    5858        aid_t req = async_send_1(exch, NS_REGISTER, service, &answer);
    59         int rc = async_connect_to_me(exch, 0, service, 0);
     59        errno_t rc = async_connect_to_me(exch, 0, service, 0);
    6060       
    6161        async_exchange_end(exch);
     
    123123
    124124
    125 int ns_ping(void)
     125errno_t ns_ping(void)
    126126{
    127127        async_sess_t *sess = ns_session_get();
     
    130130       
    131131        async_exch_t *exch = async_exchange_begin(sess);
    132         int rc = async_req_0_0(exch, NS_PING);
     132        errno_t rc = async_req_0_0(exch, NS_PING);
    133133        async_exchange_end(exch);
    134134       
     
    136136}
    137137
    138 int ns_intro(task_id_t id)
     138errno_t ns_intro(task_id_t id)
    139139{
    140140        async_exch_t *exch;
     
    144144       
    145145        exch = async_exchange_begin(sess);
    146         int rc = async_req_2_0(exch, NS_ID_INTRO, LOWER32(id), UPPER32(id));
     146        errno_t rc = async_req_2_0(exch, NS_ID_INTRO, LOWER32(id), UPPER32(id));
    147147        async_exchange_end(exch);
    148148       
Note: See TracChangeset for help on using the changeset viewer.