Changeset b7fd2a0 in mainline for uspace/app/mkfat/mkfat.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/mkfat/mkfat.c

    r36f0738 rb7fd2a0  
    8686static void syntax_print(void);
    8787
    88 static int fat_params_compute(struct fat_cfg *cfg);
    89 static int fat_blocks_write(struct fat_cfg const *cfg, service_id_t service_id);
     88static errno_t fat_params_compute(struct fat_cfg *cfg);
     89static errno_t fat_blocks_write(struct fat_cfg const *cfg, service_id_t service_id);
    9090static void fat_bootsec_create(struct fat_cfg const *cfg, struct fat_bs *bs);
    9191
     
    9494        struct fat_cfg cfg;
    9595
    96         int rc;
     96        errno_t rc;
    9797        char *dev_path;
    9898        service_id_t service_id;
     
    252252}
    253253
    254 static int fat_label_encode(void *dest, const char *src)
     254static errno_t fat_label_encode(void *dest, const char *src)
    255255{
    256256        int i;
     
    284284 * file system params.
    285285 */
    286 static int fat_params_compute(struct fat_cfg *cfg)
     286static errno_t fat_params_compute(struct fat_cfg *cfg)
    287287{
    288288        uint32_t fat_bytes;
     
    356356
    357357/** Create file system with the given parameters. */
    358 static int fat_blocks_write(struct fat_cfg const *cfg, service_id_t service_id)
     358static errno_t fat_blocks_write(struct fat_cfg const *cfg, service_id_t service_id)
    359359{
    360360        aoff64_t addr;
     
    362362        int i;
    363363        uint32_t j;
    364         int rc;
     364        errno_t rc;
    365365        struct fat_bs bs;
    366366        fat_dentry_t *de;
Note: See TracChangeset for help on using the changeset viewer.