Changeset b7fd2a0 in mainline for uspace/lib/label/src/label.c


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
  • uspace/lib/label/src/label.c

    r36f0738 rb7fd2a0  
    5151};
    5252
    53 int label_open(label_bd_t *bd, label_t **rlabel)
     53errno_t label_open(label_bd_t *bd, label_t **rlabel)
    5454{
    5555        label_ops_t **ops;
    56         int rc;
     56        errno_t rc;
    5757
    5858        ops = &probe_list[0];
     
    6767}
    6868
    69 int label_create(label_bd_t *bd, label_type_t ltype, label_t **rlabel)
     69errno_t label_create(label_bd_t *bd, label_type_t ltype, label_t **rlabel)
    7070{
    7171        label_ops_t *ops = NULL;
     
    9696}
    9797
    98 int label_destroy(label_t *label)
     98errno_t label_destroy(label_t *label)
    9999{
    100100        return label->ops->destroy(label);
    101101}
    102102
    103 int label_get_info(label_t *label, label_info_t *linfo)
     103errno_t label_get_info(label_t *label, label_info_t *linfo)
    104104{
    105105        return label->ops->get_info(label, linfo);
     
    121121}
    122122
    123 int label_part_create(label_t *label, label_part_spec_t *pspec,
     123errno_t label_part_create(label_t *label, label_part_spec_t *pspec,
    124124    label_part_t **rpart)
    125125{
     
    127127}
    128128
    129 int label_part_destroy(label_part_t *part)
     129errno_t label_part_destroy(label_part_t *part)
    130130{
    131131        return part->label->ops->part_destroy(part);
     
    137137}
    138138
    139 int label_suggest_ptype(label_t *label, label_pcnt_t pcnt,
     139errno_t label_suggest_ptype(label_t *label, label_pcnt_t pcnt,
    140140    label_ptype_t *ptype)
    141141{
Note: See TracChangeset for help on using the changeset viewer.