Changeset 736a330 in mainline


Ignore:
Timestamp:
2010-11-07T21:12:33Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9ee9d5d
Parents:
278b97b1
Message:

Get rid of the ERROR_CODE madness in generic char map.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/adt/generic_char_map.h

    r278b97b1 r736a330  
    4040#include <unistd.h>
    4141#include <errno.h>
    42 #include <err.h>
    4342
    4443#include <adt/char_map.h>
     
    8584             type *value) \
    8685        { \
    87                 ERROR_DECLARE; \
     86                int rc; \
    8887                int index; \
    8988                if (!name##_is_valid(map)) \
     
    9291                if (index < 0) \
    9392                        return index; \
    94                 if (ERROR_OCCURRED(char_map_add(&map->names, name, length, \
    95                     index))) { \
     93                rc = char_map_add(&map->names, name, length, index); \
     94                if (rc != EOK) { \
    9695                        name##_items_exclude_index(&map->values, index); \
    97                         return ERROR_CODE; \
     96                        return rc; \
    9897                } \
    9998                return EOK; \
     
    141140        int name##_initialize(name##_ref map) \
    142141        { \
    143                 ERROR_DECLARE; \
     142                int rc; \
    144143                if (!map) \
    145144                        return EINVAL; \
    146                 ERROR_PROPAGATE(char_map_initialize(&map->names)); \
    147                 if (ERROR_OCCURRED(name##_items_initialize(&map->values))) { \
     145                rc = char_map_initialize(&map->names); \
     146                if (rc != EOK) \
     147                        return rc; \
     148                rc = name##_items_initialize(&map->values); \
     149                if (rc != EOK) { \
    148150                        char_map_destroy(&map->names); \
    149                         return ERROR_CODE; \
     151                        return rc; \
    150152                } \
    151153                map->magic = GENERIC_CHAR_MAP_MAGIC_VALUE; \
Note: See TracChangeset for help on using the changeset viewer.