Changeset b7fd2a0 in mainline for uspace/drv/hid/xtkbd


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.

Location:
uspace/drv/hid/xtkbd
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/hid/xtkbd/main.c

    r36f0738 rb7fd2a0  
    4646#define NAME "xtkbd"
    4747
    48 static int xt_kbd_add(ddf_dev_t *device);
     48static errno_t xt_kbd_add(ddf_dev_t *device);
    4949
    5050/** DDF driver ops. */
     
    8383 *
    8484 */
    85 static int xt_kbd_add(ddf_dev_t *device)
     85static errno_t xt_kbd_add(ddf_dev_t *device)
    8686{
    87         int rc;
     87        errno_t rc;
    8888
    8989        if (!device)
  • uspace/drv/hid/xtkbd/xtkbd.c

    r36f0738 rb7fd2a0  
    205205 *
    206206 */
    207 static int polling(void *arg)
     207static errno_t polling(void *arg)
    208208{
    209209        xt_kbd_t *kbd = arg;
    210210        size_t nread;
    211         int rc;
     211        errno_t rc;
    212212       
    213213        while (true) {
     
    353353               
    354354                size_t nwr;
    355                 int rc = chardev_write(kbd->chardev, &cmds[0], 1, &nwr);
     355                errno_t rc = chardev_write(kbd->chardev, &cmds[0], 1, &nwr);
    356356                if (rc != EOK) {
    357357                        async_answer_0(icallid, rc);
     
    410410 *
    411411 */
    412 int xt_kbd_init(xt_kbd_t *kbd, ddf_dev_t *dev)
     412errno_t xt_kbd_init(xt_kbd_t *kbd, ddf_dev_t *dev)
    413413{
    414414        async_sess_t *parent_sess;
    415415        bool bound = false;
    416         int rc;
     416        errno_t rc;
    417417       
    418418        kbd->client_sess = NULL;
  • uspace/drv/hid/xtkbd/xtkbd.h

    r36f0738 rb7fd2a0  
    5555} xt_kbd_t;
    5656
    57 extern int xt_kbd_init(xt_kbd_t *, ddf_dev_t *);
     57extern errno_t xt_kbd_init(xt_kbd_t *, ddf_dev_t *);
    5858
    5959#endif
Note: See TracChangeset for help on using the changeset viewer.