Changeset 46577995 in mainline for uspace/lib/trackmod/protracker.c


Ignore:
Timestamp:
2018-01-04T20:50:52Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
e211ea04
Parents:
facacc71
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-04 20:47:53)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-01-04 20:50:52)
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.

After this commit, HelenOS is free of code that mixes error codes with non-error
values on the assumption that error codes are negative.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/trackmod/protracker.c

    rfacacc71 r46577995  
    7979 * @return         EOK on success, EINVAL if tag is not recognized.
    8080 */
    81 static int smp_tag_decode(uint8_t *tag, size_t *channels)
     81static errno_t smp_tag_decode(uint8_t *tag, size_t *channels)
    8282{
    8383        size_t nentries = sizeof(smp_tags) / sizeof(smptag_desc_t);
     
    138138 * @return       EOK on success, ENOMEM if out of memory, EIO on I/O error.
    139139 */
    140 static int protracker_load_patterns(FILE *f, trackmod_module_t *module)
     140static errno_t protracker_load_patterns(FILE *f, trackmod_module_t *module)
    141141{
    142142        size_t cells;
    143143        size_t i, j;
    144         int rc;
     144        errno_t rc;
    145145        size_t nread;
    146146        uint32_t *buf = NULL;
     
    191191 * @return       EOk on success, ENOMEM if out of memory, EIO on I/O error.
    192192 */
    193 static int protracker_load_samples(FILE *f, protracker_smp_t *smp,
     193static errno_t protracker_load_samples(FILE *f, protracker_smp_t *smp,
    194194    trackmod_module_t *module)
    195195{
    196         int rc;
     196        errno_t rc;
    197197        size_t i;
    198198        uint8_t ftval;
     
    256256 *                or if any error is found in the format of the file.
    257257 */
    258 int trackmod_protracker_load(char *fname, trackmod_module_t **rmodule)
     258errno_t trackmod_protracker_load(char *fname, trackmod_module_t **rmodule)
    259259{
    260260        FILE *f = NULL;
     
    269269        size_t i;
    270270        size_t nread;
    271         int rc;
     271        errno_t rc;
    272272
    273273        f = fopen(fname, "rb");
Note: See TracChangeset for help on using the changeset viewer.