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
  • kernel/generic/src/udebug/udebug_ipc.c

    r36f0738 rb7fd2a0  
    5151#include <udebug/udebug_ipc.h>
    5252
    53 int udebug_request_preprocess(call_t *call, phone_t *phone)
     53errno_t udebug_request_preprocess(call_t *call, phone_t *phone)
    5454{
    5555        switch (IPC_GET_ARG1(call->data)) {
     
    7171static void udebug_receive_begin(call_t *call)
    7272{
    73         int rc;
     73        errno_t rc;
    7474        bool active;
    7575
     
    9898static void udebug_receive_end(call_t *call)
    9999{
    100         int rc;
     100        errno_t rc;
    101101
    102102        rc = udebug_end();
     
    113113static void udebug_receive_set_evmask(call_t *call)
    114114{
    115         int rc;
     115        errno_t rc;
    116116        udebug_evmask_t mask;
    117117
     
    132132{
    133133        thread_t *t;
    134         int rc;
     134        errno_t rc;
    135135
    136136        t = (thread_t *)IPC_GET_ARG2(call->data);
     
    152152{
    153153        thread_t *t;
    154         int rc;
     154        errno_t rc;
    155155
    156156        t = (thread_t *)IPC_GET_ARG2(call->data);
     
    172172        void *buffer;
    173173        size_t copied, needed;
    174         int rc;
     174        errno_t rc;
    175175
    176176        uspace_addr = IPC_GET_ARG2(call->data); /* Destination address */
     
    307307        thread_t *t;
    308308        sysarg_t uspace_addr;
    309         int rc;
     309        errno_t rc;
    310310        void *buffer;
    311311
     
    346346        sysarg_t to_copy;
    347347        void *buffer = NULL;
    348         int rc;
     348        errno_t rc;
    349349
    350350        t = (thread_t *) IPC_GET_ARG2(call->data);
     
    390390        unsigned size;
    391391        void *buffer = NULL;
    392         int rc;
     392        errno_t rc;
    393393
    394394        uspace_dst = IPC_GET_ARG2(call->data);
Note: See TracChangeset for help on using the changeset viewer.