Ignore:
Timestamp:
2018-01-13T03:10:29Z (7 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/srv/hw/char/s3c24xx_uart/s3c24xx_uart.c

    r36f0738 rb7fd2a0  
    6969static void s3c24xx_uart_sendb(s3c24xx_uart_t *, uint8_t);
    7070
    71 static int s3c24xx_uart_read(chardev_srv_t *, void *, size_t, size_t *);
    72 static int s3c24xx_uart_write(chardev_srv_t *, const void *, size_t, size_t *);
     71static errno_t s3c24xx_uart_read(chardev_srv_t *, void *, size_t, size_t *);
     72static errno_t s3c24xx_uart_write(chardev_srv_t *, const void *, size_t, size_t *);
    7373
    7474static chardev_ops_t s3c24xx_uart_chardev_ops = {
     
    8282       
    8383        async_set_fallback_port_handler(s3c24xx_uart_connection, uart);
    84         int rc = loc_server_register(NAME);
     84        errno_t rc = loc_server_register(NAME);
    8585        if (rc != EOK) {
    8686                printf("%s: Unable to register server.\n", NAME);
     
    124124static void s3c24xx_uart_irq_handler(ipc_call_t *call, void *arg)
    125125{
    126         int rc;
     126        errno_t rc;
    127127
    128128        (void) call;
     
    200200}
    201201
    202 static int s3c24xx_uart_read(chardev_srv_t *srv, void *buf, size_t size,
     202static errno_t s3c24xx_uart_read(chardev_srv_t *srv, void *buf, size_t size,
    203203    size_t *nread)
    204204{
     
    206206        size_t p;
    207207        uint8_t *bp = (uint8_t *) buf;
    208         int rc;
     208        errno_t rc;
    209209
    210210        fibril_mutex_lock(&uart->buf_lock);
     
    227227}
    228228
    229 static int s3c24xx_uart_write(chardev_srv_t *srv, const void *data, size_t size,
     229static errno_t s3c24xx_uart_write(chardev_srv_t *srv, const void *data, size_t size,
    230230    size_t *nwr)
    231231{
Note: See TracChangeset for help on using the changeset viewer.