Changeset 46577995 in mainline for uspace/srv/hid/isdv4_tablet/isdv4.c


Ignore:
Timestamp:
2018-01-04T20:50:52Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
e211ea04
Parents:
facacc71
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-04 20:47:53)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-04 20:50:52)
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.

After this commit, HelenOS is free of code that mixes error codes with non-error
values on the assumption that error codes are negative.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/isdv4_tablet/isdv4.c

    rfacacc71 r46577995  
    294294}
    295295
    296 static int read_packets(isdv4_state_t *state, packet_consumer_fn consumer)
     296static errno_t read_packets(isdv4_state_t *state, packet_consumer_fn consumer)
    297297{
    298298        bool reading = true;
    299299        while (reading) {
    300300                size_t nread;
    301                 int rc;
     301                errno_t rc;
    302302
    303303                rc = chardev_read(state->chardev, state->buf + state->buf_end,
     
    363363static bool write_command(chardev_t *chardev, uint8_t command)
    364364{
    365         int rc;
     365        errno_t rc;
    366366        size_t nwr;
    367367
     
    370370}
    371371
    372 int isdv4_init(isdv4_state_t *state, async_sess_t *sess,
     372errno_t isdv4_init(isdv4_state_t *state, async_sess_t *sess,
    373373    isdv4_event_fn event_fn)
    374374{
    375375        chardev_t *chardev;
    376         int rc;
     376        errno_t rc;
    377377
    378378        rc = chardev_open(sess, &chardev);
     
    396396}
    397397
    398 int isdv4_init_tablet(isdv4_state_t *state)
     398errno_t isdv4_init_tablet(isdv4_state_t *state)
    399399{
    400400        if (!write_command(state->chardev, CMD_STOP))
     
    407407                return EIO;
    408408
    409         int rc = read_packets(state, parse_response_stylus);
     409        errno_t rc = read_packets(state, parse_response_stylus);
    410410        if (rc != EOK)
    411411                return rc;
     
    424424}
    425425
    426 int isdv4_read_events(isdv4_state_t *state)
     426errno_t isdv4_read_events(isdv4_state_t *state)
    427427{
    428428        return read_packets(state, parse_event);
Note: See TracChangeset for help on using the changeset viewer.