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

    r36f0738 rb7fd2a0  
    106106         *
    107107         */
    108         int (*start)(struct ieee80211_dev *);
     108        errno_t (*start)(struct ieee80211_dev *);
    109109       
    110110        /** Scan neighborhood for networks.
     
    118118         *
    119119         */
    120         int (*scan)(struct ieee80211_dev *);
     120        errno_t (*scan)(struct ieee80211_dev *);
    121121       
    122122        /** Handler for TX frames to be send from device.
     
    132132         *
    133133         */
    134         int (*tx_handler)(struct ieee80211_dev *, void *, size_t);
     134        errno_t (*tx_handler)(struct ieee80211_dev *, void *, size_t);
    135135       
    136136        /** Set device operating frequency to given value.
     
    142142         *
    143143         */
    144         int (*set_freq)(struct ieee80211_dev *, uint16_t);
     144        errno_t (*set_freq)(struct ieee80211_dev *, uint16_t);
    145145       
    146146        /** Callback to inform device about BSSID change.
     
    152152         *
    153153         */
    154         int (*bssid_change)(struct ieee80211_dev *, bool);
     154        errno_t (*bssid_change)(struct ieee80211_dev *, bool);
    155155       
    156156        /** Callback to setup encryption key in IEEE 802.11 device.
     
    164164         *
    165165         */
    166         int (*key_config)(struct ieee80211_dev *,
     166        errno_t (*key_config)(struct ieee80211_dev *,
    167167            ieee80211_key_config_t *key_conf, bool);
    168168} ieee80211_ops_t;
     
    170170/* Initialization functions. */
    171171extern ieee80211_dev_t *ieee80211_device_create(void);
    172 extern int ieee80211_device_init(ieee80211_dev_t *, ddf_dev_t *);
    173 extern int ieee80211_init(ieee80211_dev_t *, ieee80211_ops_t *,
     172extern errno_t ieee80211_device_init(ieee80211_dev_t *, ddf_dev_t *);
     173extern errno_t ieee80211_init(ieee80211_dev_t *, ieee80211_ops_t *,
    174174    ieee80211_iface_t *, nic_iface_t *, ddf_dev_ops_t *);
    175175
     
    201201
    202202/* Worker functions. */
    203 extern int ieee80211_rx_handler(ieee80211_dev_t *, void *, size_t);
     203extern errno_t ieee80211_rx_handler(ieee80211_dev_t *, void *, size_t);
    204204
    205205#endif
Note: See TracChangeset for help on using the changeset viewer.