Changeset b7fd2a0 in mainline for uspace/lib/c/generic/io/con_srv.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/io/con_srv.c

    r36f0738 rb7fd2a0  
    4242#include <io/con_srv.h>
    4343
    44 static int console_ev_encode(cons_event_t *event, ipc_call_t *call)
     44static errno_t console_ev_encode(cons_event_t *event, ipc_call_t *call)
    4545{
    4646        IPC_SET_ARG1(*call, event->type);
     
    7171        void *buf;
    7272        size_t size;
    73         int rc;
     73        errno_t rc;
    7474        ipc_callid_t rcallid;
    7575
     
    113113        void *data;
    114114        size_t size;
    115         int rc;
     115        errno_t rc;
    116116
    117117        rc = async_data_write_accept(&data, false, 0, 0, 0, &size);
     
    178178    ipc_call_t *call)
    179179{
    180         int rc;
     180        errno_t rc;
    181181        sysarg_t col;
    182182        sysarg_t row;
     
    194194    ipc_call_t *call)
    195195{
    196         int rc;
     196        errno_t rc;
    197197        sysarg_t cols;
    198198        sysarg_t rows;
     
    210210    ipc_call_t *call)
    211211{
    212         int rc;
     212        errno_t rc;
    213213        console_caps_t ccap;
    214214
     
    295295    ipc_call_t *call)
    296296{
    297         int rc;
     297        errno_t rc;
    298298        cons_event_t event;
    299299        ipc_call_t result;
     
    340340}
    341341
    342 int con_conn(ipc_callid_t iid, ipc_call_t *icall, con_srvs_t *srvs)
     342errno_t con_conn(ipc_callid_t iid, ipc_call_t *icall, con_srvs_t *srvs)
    343343{
    344344        con_srv_t *srv;
    345         int rc;
     345        errno_t rc;
    346346
    347347        /* Accept the connection */
Note: See TracChangeset for help on using the changeset viewer.