Changeset b7fd2a0 in mainline for uspace/app/devctl/devctl.c


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/app/devctl/devctl.c

    r36f0738 rb7fd2a0  
    7070}
    7171
    72 static int fun_subtree_print(devman_handle_t funh, int lvl)
     72static errno_t fun_subtree_print(devman_handle_t funh, int lvl)
    7373{
    7474        devman_handle_t devh;
     
    7676        size_t count, i;
    7777        unsigned int score;
    78         int rc;
     78        errno_t rc;
    7979        int j;
    8080
     
    136136}
    137137
    138 static int fun_tree_print(void)
     138static errno_t fun_tree_print(void)
    139139{
    140140        devman_handle_t root_fun;
    141         int rc;
     141        errno_t rc;
    142142
    143143        rc = devman_fun_get_handle("/", &root_fun, 0);
     
    154154}
    155155
    156 static int fun_online(const char *path)
     156static errno_t fun_online(const char *path)
    157157{
    158158        devman_handle_t funh;
    159         int rc;
     159        errno_t rc;
    160160
    161161        rc = devman_fun_get_handle(path, &funh, 0);
     
    175175}
    176176
    177 static int fun_offline(const char *path)
     177static errno_t fun_offline(const char *path)
    178178{
    179179        devman_handle_t funh;
    180         int rc;
     180        errno_t rc;
    181181
    182182        rc = devman_fun_get_handle(path, &funh, 0);
     
    197197}
    198198
    199 static int drv_list(void)
     199static errno_t drv_list(void)
    200200{
    201201        devman_handle_t *devs;
     
    207207        size_t i;
    208208        table_t *table = NULL;
    209         int rc;
     209        errno_t rc;
    210210
    211211        rc = devman_get_drivers(&drvs, &ndrvs);
     
    252252}
    253253
    254 static int drv_show(char *drvname)
     254static errno_t drv_show(char *drvname)
    255255{
    256256        devman_handle_t *devs;
     
    262262        size_t ndevs;
    263263        size_t i;
    264         int rc;
     264        errno_t rc;
    265265
    266266        rc = devman_driver_get_handle(drvname, &drvh);
     
    317317}
    318318
    319 static int drv_load(const char *drvname)
    320 {
    321         int rc;
     319static errno_t drv_load(const char *drvname)
     320{
     321        errno_t rc;
    322322        devman_handle_t drvh;
    323323
     
    337337}
    338338
    339 static int drv_unload(const char *drvname)
    340 {
    341         int rc;
     339static errno_t drv_unload(const char *drvname)
     340{
     341        errno_t rc;
    342342        devman_handle_t drvh;
    343343
     
    371371int main(int argc, char *argv[])
    372372{
    373         int rc;
     373        errno_t rc;
    374374
    375375        if (argc == 1 || argv[1][0] == '-') {
Note: See TracChangeset for help on using the changeset viewer.