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/nic/include/nic_rx_control.h

    r36f0738 rb7fd2a0  
    114114} __attribute__ ((packed)) vlan_header_t;
    115115
    116 extern int nic_rxc_init(nic_rxc_t *rxc);
    117 extern int nic_rxc_clear(nic_rxc_t *rxc);
    118 extern int nic_rxc_set_addr(nic_rxc_t *rxc,
     116extern errno_t nic_rxc_init(nic_rxc_t *rxc);
     117extern errno_t nic_rxc_clear(nic_rxc_t *rxc);
     118extern errno_t nic_rxc_set_addr(nic_rxc_t *rxc,
    119119        const nic_address_t *prev_addr, const nic_address_t *curr_addr);
    120120extern bool nic_rxc_check(const nic_rxc_t *rxc,
     
    126126extern void nic_rxc_unicast_get_mode(const nic_rxc_t *, nic_unicast_mode_t *,
    127127        size_t max_count, nic_address_t *address_list, size_t *address_count);
    128 extern int nic_rxc_unicast_set_mode(nic_rxc_t *rxc, nic_unicast_mode_t mode,
     128extern errno_t nic_rxc_unicast_set_mode(nic_rxc_t *rxc, nic_unicast_mode_t mode,
    129129        const nic_address_t *address_list, size_t address_count);
    130130extern void nic_rxc_multicast_get_mode(const nic_rxc_t *,
    131131        nic_multicast_mode_t *, size_t, nic_address_t *, size_t *);
    132 extern int nic_rxc_multicast_set_mode(nic_rxc_t *, nic_multicast_mode_t mode,
     132extern errno_t nic_rxc_multicast_set_mode(nic_rxc_t *, nic_multicast_mode_t mode,
    133133        const nic_address_t *address_list, size_t address_count);
    134134extern void nic_rxc_broadcast_get_mode(const nic_rxc_t *,
    135135        nic_broadcast_mode_t *mode);
    136 extern int nic_rxc_broadcast_set_mode(nic_rxc_t *,
     136extern errno_t nic_rxc_broadcast_set_mode(nic_rxc_t *,
    137137        nic_broadcast_mode_t mode);
    138138extern void nic_rxc_blocked_sources_get(const nic_rxc_t *,
    139139        size_t max_count, nic_address_t *address_list, size_t *address_count);
    140 extern int nic_rxc_blocked_sources_set(nic_rxc_t *,
     140extern errno_t nic_rxc_blocked_sources_set(nic_rxc_t *,
    141141        const nic_address_t *address_list, size_t address_count);
    142 extern int nic_rxc_vlan_get_mask(const nic_rxc_t *rxc, nic_vlan_mask_t *mask);
    143 extern int nic_rxc_vlan_set_mask(nic_rxc_t *rxc, const nic_vlan_mask_t *mask);
     142extern errno_t nic_rxc_vlan_get_mask(const nic_rxc_t *rxc, nic_vlan_mask_t *mask);
     143extern errno_t nic_rxc_vlan_set_mask(nic_rxc_t *rxc, const nic_vlan_mask_t *mask);
    144144
    145145#endif
Note: See TracChangeset for help on using the changeset viewer.