Changeset b7fd2a0 in mainline for uspace/lib/nettl/include


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.

Location:
uspace/lib/nettl/include/nettl
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/nettl/include/nettl/amap.h

    r36f0738 rb7fd2a0  
    9191} amap_flags_t;
    9292
    93 extern int amap_create(amap_t **);
     93extern errno_t amap_create(amap_t **);
    9494extern void amap_destroy(amap_t *);
    95 extern int amap_insert(amap_t *, inet_ep2_t *, void *, amap_flags_t,
     95extern errno_t amap_insert(amap_t *, inet_ep2_t *, void *, amap_flags_t,
    9696    inet_ep2_t *);
    9797extern void amap_remove(amap_t *, inet_ep2_t *);
    98 extern int amap_find_match(amap_t *, inet_ep2_t *, void **);
     98extern errno_t amap_find_match(amap_t *, inet_ep2_t *, void **);
    9999
    100100#endif
  • uspace/lib/nettl/include/nettl/portrng.h

    r36f0738 rb7fd2a0  
    5858} portrng_flags_t;
    5959
    60 extern int portrng_create(portrng_t **);
     60extern errno_t portrng_create(portrng_t **);
    6161extern void portrng_destroy(portrng_t *);
    62 extern int portrng_alloc(portrng_t *, uint16_t, void *,
     62extern errno_t portrng_alloc(portrng_t *, uint16_t, void *,
    6363    portrng_flags_t, uint16_t *);
    64 extern int portrng_find_port(portrng_t *, uint16_t, void **);
     64extern errno_t portrng_find_port(portrng_t *, uint16_t, void **);
    6565extern void portrng_free_port(portrng_t *, uint16_t);
    6666extern bool portrng_empty(portrng_t *);
Note: See TracChangeset for help on using the changeset viewer.