Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/bithenge/src/tree.c

    rb7fd2a0 r6cd10ac  
    8686} get_for_each_data_t;
    8787
    88 static errno_t get_for_each_func(bithenge_node_t *key, bithenge_node_t *value,
     88static int get_for_each_func(bithenge_node_t *key, bithenge_node_t *value,
    8989    void *raw_data)
    9090{
    9191        get_for_each_data_t *data = (get_for_each_data_t *)raw_data;
    9292        bool equal;
    93         errno_t rc = bithenge_node_equal(&equal, key, data->key);
     93        int rc = bithenge_node_equal(&equal, key, data->key);
    9494        bithenge_node_dec_ref(key);
    9595        if (rc != EOK)
     
    113113 * @return EOK on success, ENOENT if not found, or another error code from
    114114 * errno.h. */
    115 errno_t bithenge_node_get(bithenge_node_t *self, bithenge_node_t *key,
     115int bithenge_node_get(bithenge_node_t *self, bithenge_node_t *key,
    116116    bithenge_node_t **out)
    117117{
     
    125125                uint8_t byte;
    126126                aoff64_t size = 1;
    127                 errno_t rc = bithenge_blob_read(bithenge_node_as_blob(self),
     127                int rc = bithenge_blob_read(bithenge_node_as_blob(self),
    128128                    offset, (char *)&byte, &size);
    129129                if (rc != EOK)
     
    140140        *out = NULL;
    141141        get_for_each_data_t data = {key, out};
    142         errno_t rc = bithenge_node_for_each(self, get_for_each_func, &data);
     142        int rc = bithenge_node_for_each(self, get_for_each_func, &data);
    143143        bithenge_node_dec_ref(key);
    144144        if (rc == EEXIST && *out)
     
    155155 * @param[in] ops The operations provided.
    156156 * @return EOK on success or an error code from errno.h. */
    157 errno_t bithenge_init_internal_node(bithenge_node_t *self,
     157int bithenge_init_internal_node(bithenge_node_t *self,
    158158    const bithenge_internal_node_ops_t *ops)
    159159{
     
    169169}
    170170
    171 static errno_t empty_internal_node_for_each(bithenge_node_t *base,
     171static int empty_internal_node_for_each(bithenge_node_t *base,
    172172    bithenge_for_each_func_t func, void *data)
    173173{
     
    175175}
    176176
    177 static errno_t empty_internal_node_get(bithenge_node_t *self, bithenge_node_t *key,
     177static int empty_internal_node_get(bithenge_node_t *self, bithenge_node_t *key,
    178178    bithenge_node_t **out)
    179179{
     
    196196 * @param[out] out Holds the created node.
    197197 * @return EOK on success or an error code from errno.h. */
    198 errno_t bithenge_new_empty_internal_node(bithenge_node_t **out)
     198int bithenge_new_empty_internal_node(bithenge_node_t **out)
    199199{
    200200        if (bithenge_should_fail())
     
    223223}
    224224
    225 static errno_t simple_internal_node_for_each(bithenge_node_t *base,
     225static int simple_internal_node_for_each(bithenge_node_t *base,
    226226    bithenge_for_each_func_t func, void *data)
    227227{
    228         errno_t rc;
     228        int rc;
    229229        simple_internal_node_t *self = node_as_simple(base);
    230230        for (bithenge_int_t i = 0; i < self->len; i++) {
     
    264264 * the nodes array rather than just dereferencing each node inside it.
    265265 * @return EOK on success or an error code from errno.h. */
    266 errno_t bithenge_new_simple_internal_node(bithenge_node_t **out,
     266int bithenge_new_simple_internal_node(bithenge_node_t **out,
    267267    bithenge_node_t **nodes, bithenge_int_t len, bool needs_free)
    268268{
    269         errno_t rc;
     269        int rc;
    270270        assert(out);
    271271        simple_internal_node_t *self = malloc(sizeof(*self));
     
    300300 * @param value The value for the node to hold.
    301301 * @return EOK on success or an error code from errno.h. */
    302 errno_t bithenge_new_boolean_node(bithenge_node_t **out, bool value)
     302int bithenge_new_boolean_node(bithenge_node_t **out, bool value)
    303303{
    304304        assert(out);
     
    315315 * @param value The value for the node to hold.
    316316 * @return EOK on success or an error code from errno.h. */
    317 errno_t bithenge_new_integer_node(bithenge_node_t **out, bithenge_int_t value)
     317int bithenge_new_integer_node(bithenge_node_t **out, bithenge_int_t value)
    318318{
    319319        assert(out);
     
    335335 * destroyed.
    336336 * @return EOK on success or an error code from errno.h. */
    337 errno_t bithenge_new_string_node(bithenge_node_t **out, const char *value, bool needs_free)
     337int bithenge_new_string_node(bithenge_node_t **out, const char *value, bool needs_free)
    338338{
    339339        assert(out);
     
    359359 * @return EOK on success or an error code from errno.h.
    360360 * @todo Add support for internal nodes. */
    361 errno_t bithenge_node_equal(bool *out, bithenge_node_t *a, bithenge_node_t *b)
     361int bithenge_node_equal(bool *out, bithenge_node_t *a, bithenge_node_t *b)
    362362{
    363363        if (a->type != b->type) {
Note: See TracChangeset for help on using the changeset viewer.