Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 162313c in mainline


Ignore:
Timestamp:
2020-03-14T15:36:04Z (3 weeks ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
23234584
Parents:
2e03c02
git-author:
Matthieu Riolo <matthieu.riolo@…> (2019-09-06 17:58:36)
git-committer:
Matthieu Riolo <matthieu.riolo@…> (2020-03-14 15:36:04)
Message:

Replacing int with errno_t

The merged code from system-daemon still used the type int
for indicating an error instead of using errno_t. This
commit corrects this mistake

Conflicts:

uspace/srv/net/udp/cassoc.h
uspace/srv/sysman/connection_broker.c
uspace/srv/sysman/connection_ctl.c
uspace/srv/sysman/edge.c
uspace/srv/sysman/edge.h
uspace/srv/sysman/job.c
uspace/srv/sysman/job_closure.c
uspace/srv/sysman/job_closure.h
uspace/srv/sysman/job_queue.c
uspace/srv/sysman/job_queue.h
uspace/srv/sysman/repo.c
uspace/srv/sysman/repo.h
uspace/srv/sysman/sm_task.c
uspace/srv/sysman/sysman.c
uspace/srv/sysman/test/job_closure.c
uspace/srv/sysman/test/job_queue.c
uspace/srv/sysman/test/mock_unit.c
uspace/srv/sysman/test/mock_unit.h
uspace/srv/sysman/unit.c
uspace/srv/sysman/unit.h
uspace/srv/sysman/units/unit_tgt.c
uspace/srv/taskman/task.c
uspace/srv/taskman/task.h

Location:
uspace/lib/c
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/adt/dyn_array.c

    r2e03c02 r162313c  
    4444#include <stdlib.h>
    4545
    46 static int dyn_array_realloc(dyn_array_t *da, size_t capacity)
     46static errno_t dyn_array_realloc(dyn_array_t *da, size_t capacity)
    4747{
    4848        if (capacity == da->capacity) {
     
    7070        assert(index < da->size);
    7171        _dyn_array_unshift(da, index, 1);
    72         int rc = dyn_array_reserve(da, da->size);
     72        errno_t rc = dyn_array_reserve(da, da->size);
    7373        assert(rc == EOK);
    7474}
     
    9292
    9393        _dyn_array_unshift(da, begin, end - begin);
    94         int rc = dyn_array_reserve(da, da->size);
     94        errno_t rc = dyn_array_reserve(da, da->size);
    9595        assert(rc == EOK);
    9696}
     
    104104 * @return ENOMEM when allocation fails
    105105 */
    106 int dyn_array_concat(dyn_array_t *da1, dyn_array_t *da2)
     106errno_t dyn_array_concat(dyn_array_t *da1, dyn_array_t *da2)
    107107{
    108108        assert(da1->_item_size == da2->_item_size);
    109109
    110         int rc = dyn_array_reserve(da1, da1->size + da2->size);
     110        errno_t rc = dyn_array_reserve(da1, da1->size + da2->size);
    111111        if (rc != EOK) {
    112112                return rc;
     
    129129 * @return ENOMEM
    130130 */
    131 int dyn_array_reserve(dyn_array_t *da, size_t capacity)
     131errno_t dyn_array_reserve(dyn_array_t *da, size_t capacity)
    132132{
    133133        const size_t factor = 2;
  • uspace/lib/c/include/adt/dyn_array.h

    r2e03c02 r162313c  
    3636#define LIBC_DYN_ARRAY_H_
    3737
     38#include <errno.h>
    3839#include <stdbool.h>
    3940#include <stddef.h>
     
    8384        size_t _index = (index);                                               \
    8485        dyn_array_t *_da = (dyn_array);                                        \
    85         int rc = dyn_array_reserve(_da, _da->size + 1);                        \
     86        errno_t rc = dyn_array_reserve(_da, _da->size + 1);                        \
    8687        if (!rc) {                                                             \
    8788                _dyn_array_shift(_da, _index, 1);                              \
     
    134135void dyn_array_clear(dyn_array_t *);
    135136void dyn_array_clear_range(dyn_array_t *, size_t, size_t);
    136 extern int dyn_array_concat(dyn_array_t *, dyn_array_t *);
    137 extern int dyn_array_reserve(dyn_array_t *, size_t);
     137extern errno_t dyn_array_concat(dyn_array_t *, dyn_array_t *);
     138extern errno_t dyn_array_reserve(dyn_array_t *, size_t);
    138139
    139140extern void _dyn_array_initialize(dyn_array_t *, size_t);
  • uspace/lib/c/test/dyn_array.c

    r2e03c02 r162313c  
    4141{
    4242        dyn_array_initialize(&da, data_t);
    43         int rc = dyn_array_reserve(&da, 3);
     43        errno_t rc = dyn_array_reserve(&da, 3);
    4444        assert(rc == EOK);
    4545}
Note: See TracChangeset for help on using the changeset viewer.