Ignore:
Timestamp:
2018-01-13T03:10:29Z (8 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/include/inet/iplink_srv.h

    r36f0738 rb7fd2a0  
    5353
    5454typedef struct iplink_ops {
    55         int (*open)(iplink_srv_t *);
    56         int (*close)(iplink_srv_t *);
    57         int (*send)(iplink_srv_t *, iplink_sdu_t *);
    58         int (*send6)(iplink_srv_t *, iplink_sdu6_t *);
    59         int (*get_mtu)(iplink_srv_t *, size_t *);
    60         int (*get_mac48)(iplink_srv_t *, addr48_t *);
    61         int (*set_mac48)(iplink_srv_t *, addr48_t *);
    62         int (*addr_add)(iplink_srv_t *, inet_addr_t *);
    63         int (*addr_remove)(iplink_srv_t *, inet_addr_t *);
     55        errno_t (*open)(iplink_srv_t *);
     56        errno_t (*close)(iplink_srv_t *);
     57        errno_t (*send)(iplink_srv_t *, iplink_sdu_t *);
     58        errno_t (*send6)(iplink_srv_t *, iplink_sdu6_t *);
     59        errno_t (*get_mtu)(iplink_srv_t *, size_t *);
     60        errno_t (*get_mac48)(iplink_srv_t *, addr48_t *);
     61        errno_t (*set_mac48)(iplink_srv_t *, addr48_t *);
     62        errno_t (*addr_add)(iplink_srv_t *, inet_addr_t *);
     63        errno_t (*addr_remove)(iplink_srv_t *, inet_addr_t *);
    6464} iplink_ops_t;
    6565
    6666extern void iplink_srv_init(iplink_srv_t *);
    6767
    68 extern int iplink_conn(ipc_callid_t, ipc_call_t *, void *);
    69 extern int iplink_ev_recv(iplink_srv_t *, iplink_recv_sdu_t *, ip_ver_t);
    70 extern int iplink_ev_change_addr(iplink_srv_t *, addr48_t *);
     68extern errno_t iplink_conn(ipc_callid_t, ipc_call_t *, void *);
     69extern errno_t iplink_ev_recv(iplink_srv_t *, iplink_recv_sdu_t *, ip_ver_t);
     70extern errno_t iplink_ev_change_addr(iplink_srv_t *, addr48_t *);
    7171
    7272#endif
Note: See TracChangeset for help on using the changeset viewer.